diff options
author | Michael Foord <fuzzyman@voidspace.org.uk> | 2010-05-04 22:29:10 +0000 |
---|---|---|
committer | Michael Foord <fuzzyman@voidspace.org.uk> | 2010-05-04 22:29:10 +0000 |
commit | 2d9c2d5ecd6d28a8d07fcef3f9e6c68dcb6e4faf (patch) | |
tree | efb994f3ab5501313e6c66fec9a19b3249ad1ab6 /Lib | |
parent | 667ce06de4e91d6e9b78d622303809b9f72c4012 (diff) | |
download | cpython3-2d9c2d5ecd6d28a8d07fcef3f9e6c68dcb6e4faf.tar.gz |
Fix error handling removing files in test.support.unlink
Diffstat (limited to 'Lib')
-rw-r--r-- | Lib/test/support.py | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/Lib/test/support.py b/Lib/test/support.py index 4ea6c055a7..08105df426 100644 --- a/Lib/test/support.py +++ b/Lib/test/support.py @@ -186,7 +186,7 @@ def unlink(filename): os.unlink(filename) except OSError as error: # The filename need not exist. - if error.errno != errno.ENOENT: + if error.errno not in (errno.ENOENT, errno.ENOTDIR): raise def rmtree(path): @@ -376,6 +376,7 @@ else: # module name. TESTFN = "{}_{}_tmp".format(TESTFN, os.getpid()) + # Assuming sys.getfilesystemencoding()!=sys.getdefaultencoding() # TESTFN_UNICODE is a filename that can be encoded using the # file system encoding, but *not* with the default (ascii) encoding |