mirror of https://github.com/python/cpython
OSError is the exception raised when one tries to create a directory that
already exists, not IOError. Part of the continuing saga of issue #9572.
This commit is contained in:
parent
816756182e
commit
a7ceeb335f
|
@ -493,13 +493,16 @@ class _SourceFileLoader(_FileLoader, SourceLoader):
|
|||
parent = _path_join(parent, part)
|
||||
try:
|
||||
_os.mkdir(parent)
|
||||
except IOError as exc:
|
||||
except OSError as exc:
|
||||
# Probably another Python process already created the dir.
|
||||
if exc.errno == errno.EEXIST:
|
||||
continue
|
||||
else:
|
||||
raise
|
||||
except IOError as exc:
|
||||
# If can't get proper access, then just forget about writing
|
||||
# the data.
|
||||
elif exc.errno == errno.EACCES:
|
||||
if exc.errno == errno.EACCES:
|
||||
return
|
||||
else:
|
||||
raise
|
||||
|
|
Loading…
Reference in New Issue