From: Victor Stinner Date: Fri, 5 May 2017 08:27:34 +0000 (+0200) Subject: bpo-30265: support.unlink() don't catch any OSError (#1456) X-Git-Tag: v2.7.14rc1~167 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=03b278895fa0db355af4e450eac71dd0532db394;p=python bpo-30265: support.unlink() don't catch any OSError (#1456) support.unlink() now only ignores ENOENT and ENOTDIR, instead of ignoring any OSError exception. --- diff --git a/Lib/test/support/__init__.py b/Lib/test/support/__init__.py index ef0ced6fae..7f3ad5c972 100644 --- a/Lib/test/support/__init__.py +++ b/Lib/test/support/__init__.py @@ -276,8 +276,9 @@ else: def unlink(filename): try: _unlink(filename) - except OSError: - pass + except OSError as exc: + if exc.errno not in (errno.ENOENT, errno.ENOTDIR): + raise def rmdir(dirname): try: