summaryrefslogtreecommitdiff
path: root/Lib/os.py
diff options
context:
space:
mode:
authorChristian Heimes <christian@cheimes.de>2007-11-27 21:50:00 +0000
committerChristian Heimes <christian@cheimes.de>2007-11-27 21:50:00 +0000
commit0a7f15896e1d7f2233f4f8b9395ccd0ac1d7c621 (patch)
tree2fee5ad8dd419f94f4958933f257199be5eb2081 /Lib/os.py
parent00590ac82d2f7ad8e1155f1db787d010f8b7ed2a (diff)
downloadcpython-0a7f15896e1d7f2233f4f8b9395ccd0ac1d7c621.tar.gz
Merged revisions 59193-59201 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/trunk ........ r59195 | facundo.batista | 2007-11-27 19:50:12 +0100 (Tue, 27 Nov 2007) | 4 lines Moved the errno import from inside the functions to the module level. Fixes issue 1755179. ........ r59199 | christian.heimes | 2007-11-27 22:28:40 +0100 (Tue, 27 Nov 2007) | 1 line Backport of changes to PCbuild9 from the py3k branch ........ r59200 | christian.heimes | 2007-11-27 22:34:01 +0100 (Tue, 27 Nov 2007) | 1 line Replaced import of the 'new' module with 'types' module and added a deprecation warning to the 'new' module. ........ r59201 | christian.heimes | 2007-11-27 22:35:44 +0100 (Tue, 27 Nov 2007) | 1 line Added a deprecation warning to the 'new' module. ........
Diffstat (limited to 'Lib/os.py')
-rw-r--r--Lib/os.py9
1 files changed, 3 insertions, 6 deletions
diff --git a/Lib/os.py b/Lib/os.py
index 451f833bf0..82b402730e 100644
--- a/Lib/os.py
+++ b/Lib/os.py
@@ -22,7 +22,7 @@ and opendir), and leave all pathname manipulation to os.path
#'
-import sys
+import sys, errno
_names = sys.builtin_module_names
@@ -140,7 +140,6 @@ def makedirs(name, mode=0o777):
recursive.
"""
- from errno import EEXIST
head, tail = path.split(name)
if not tail:
head, tail = path.split(head)
@@ -149,7 +148,7 @@ def makedirs(name, mode=0o777):
makedirs(head, mode)
except OSError as 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
@@ -353,8 +352,6 @@ def execvpe(file, args, env):
__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)
@@ -381,7 +378,7 @@ def _execvpe(file, args, env=None):
except error as e:
last_exc = 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