mirror of
https://github.com/python/cpython.git
synced 2025-08-04 00:48:58 +00:00
Fix error handling removing files in test.support.unlink
This commit is contained in:
parent
667ce06de4
commit
2d9c2d5ecd
1 changed files with 2 additions and 1 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue