summaryrefslogtreecommitdiff
path: root/Lib/importlib
diff options
context:
space:
mode:
Diffstat (limited to 'Lib/importlib')
-rw-r--r--Lib/importlib/_bootstrap.py7
1 files changed, 5 insertions, 2 deletions
diff --git a/Lib/importlib/_bootstrap.py b/Lib/importlib/_bootstrap.py
index 5566b78bf0..9130a928e8 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