diff options
author | Brett Cannon <bcannon@gmail.com> | 2010-08-26 21:07:13 (GMT) |
---|---|---|
committer | Brett Cannon <bcannon@gmail.com> | 2010-08-26 21:07:13 (GMT) |
commit | a7ceeb335f231269e7905597e6bd15ff0e302bd0 (patch) | |
tree | c3da22022d9c6bbccbf069ab640340bc09e8d666 /Lib/importlib | |
parent | 816756182e831cd51313085077b584ed150e00d7 (diff) | |
download | cpython-a7ceeb335f231269e7905597e6bd15ff0e302bd0.zip cpython-a7ceeb335f231269e7905597e6bd15ff0e302bd0.tar.gz cpython-a7ceeb335f231269e7905597e6bd15ff0e302bd0.tar.bz2 |
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.
Diffstat (limited to 'Lib/importlib')
-rw-r--r-- | Lib/importlib/_bootstrap.py | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/Lib/importlib/_bootstrap.py b/Lib/importlib/_bootstrap.py index 5566b78..9130a92 100644 --- a/Lib/importlib/_bootstrap.py +++ b/Lib/importlib/_bootstrap.py @@ -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 |