From 03b278895fa0db355af4e450eac71dd0532db394 Mon Sep 17 00:00:00 2001 From: Victor Stinner Date: Fri, 5 May 2017 10:27:34 +0200 Subject: [PATCH] bpo-30265: support.unlink() don't catch any OSError (#1456) support.unlink() now only ignores ENOENT and ENOTDIR, instead of ignoring any OSError exception. --- Lib/test/support/__init__.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) 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: -- 2.50.1