Mercurial > cpython-lru_cache-weakref
diff Lib/importlib/_bootstrap.py @ 64291:0112f064cedf
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.
| author | Brett Cannon <bcannon@gmail.com> |
|---|---|
| date | Thu, 26 Aug 2010 21:07:13 +0000 |
| parents | be76b37fe7fd |
| children | f8ba9558adbf |
line wrap: on
line diff
--- a/Lib/importlib/_bootstrap.py Thu Aug 26 14:30:56 2010 +0000 +++ b/Lib/importlib/_bootstrap.py Thu Aug 26 21:07:13 2010 +0000 @@ -493,13 +493,16 @@ 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
