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):
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
......
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