[Python-checkins] r84329 - python/branches/py3k/Lib/importlib/_bootstrap.py

brett.cannon python-checkins at python.org
Thu Aug 26 23:07:13 CEST 2010


Author: brett.cannon
Date: Thu Aug 26 23:07:13 2010
New Revision: 84329

Log:
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.


Modified:
   python/branches/py3k/Lib/importlib/_bootstrap.py

Modified: python/branches/py3k/Lib/importlib/_bootstrap.py
==============================================================================
--- python/branches/py3k/Lib/importlib/_bootstrap.py	(original)
+++ python/branches/py3k/Lib/importlib/_bootstrap.py	Thu Aug 26 23:07:13 2010
@@ -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


More information about the Python-checkins mailing list