Skip to content

Commit 03b2788

Browse files
authored
bpo-30265: support.unlink() don't catch any OSError (#1456)
support.unlink() now only ignores ENOENT and ENOTDIR, instead of ignoring any OSError exception.
1 parent 5d7a18f commit 03b2788

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

Lib/test/support/__init__.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -276,8 +276,9 @@ def _rmtree_inner(path):
276276
def unlink(filename):
277277
try:
278278
_unlink(filename)
279-
except OSError:
280-
pass
279+
except OSError as exc:
280+
if exc.errno not in (errno.ENOENT, errno.ENOTDIR):
281+
raise
281282

282283
def rmdir(dirname):
283284
try:

0 commit comments

Comments
 (0)