Commit 2d9c2d5e authored by Michael Foord's avatar Michael Foord

Fix error handling removing files in test.support.unlink

parent 667ce06d
...@@ -186,7 +186,7 @@ def unlink(filename): ...@@ -186,7 +186,7 @@ def unlink(filename):
os.unlink(filename) os.unlink(filename)
except OSError as error: except OSError as error:
# The filename need not exist. # The filename need not exist.
if error.errno != errno.ENOENT: if error.errno not in (errno.ENOENT, errno.ENOTDIR):
raise raise
def rmtree(path): def rmtree(path):
...@@ -376,6 +376,7 @@ else: ...@@ -376,6 +376,7 @@ else:
# module name. # module name.
TESTFN = "{}_{}_tmp".format(TESTFN, os.getpid()) TESTFN = "{}_{}_tmp".format(TESTFN, os.getpid())
# Assuming sys.getfilesystemencoding()!=sys.getdefaultencoding() # Assuming sys.getfilesystemencoding()!=sys.getdefaultencoding()
# TESTFN_UNICODE is a filename that can be encoded using the # TESTFN_UNICODE is a filename that can be encoded using the
# file system encoding, but *not* with the default (ascii) encoding # file system encoding, but *not* with the default (ascii) encoding
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment