[Python-checkins] r59823 - python/branches/release25-maint/Lib/os.py
facundo.batista
python-checkins at python.org
Mon Jan 7 17:49:03 CET 2008
Author: facundo.batista
Date: Mon Jan 7 17:49:02 2008
New Revision: 59823
Modified:
python/branches/release25-maint/Lib/os.py
Log:
Backport of issue 1755179 fix.
Modified: python/branches/release25-maint/Lib/os.py
==============================================================================
--- python/branches/release25-maint/Lib/os.py (original)
+++ python/branches/release25-maint/Lib/os.py Mon Jan 7 17:49:02 2008
@@ -23,7 +23,7 @@
#'
-import sys
+import sys, errno
_names = sys.builtin_module_names
@@ -156,7 +156,6 @@
recursive.
"""
- from errno import EEXIST
head, tail = path.split(name)
if not tail:
head, tail = path.split(head)
@@ -165,7 +164,7 @@
makedirs(head, mode)
except OSError, e:
# be happy if someone already created the path
- if e.errno != EEXIST:
+ if e.errno != errno.EEXIST:
raise
if tail == curdir: # xxx/newdir/. exists if xxx/newdir exists
return
@@ -365,8 +364,6 @@
__all__.extend(["execl","execle","execlp","execlpe","execvp","execvpe"])
def _execvpe(file, args, env=None):
- from errno import ENOENT, ENOTDIR
-
if env is not None:
func = execve
argrest = (args, env)
@@ -392,7 +389,7 @@
func(fullname, *argrest)
except error, e:
tb = sys.exc_info()[2]
- if (e.errno != ENOENT and e.errno != ENOTDIR
+ if (e.errno != errno.ENOENT and e.errno != errno.ENOTDIR
and saved_exc is None):
saved_exc = e
saved_tb = tb
More information about the Python-checkins
mailing list