[Python-checkins] cpython: Fix os.__all__ to is passes test___all__

richard.oudkerk python-checkins at python.org
Tue May 7 15:26:19 CEST 2013


http://hg.python.org/cpython/rev/4f82b6cfee46
changeset:   83671:4f82b6cfee46
user:        Richard Oudkerk <shibturn at gmail.com>
date:        Tue May 07 14:23:42 2013 +0100
summary:
  Fix os.__all__ to is passes test___all__

files:
  Lib/os.py |  14 ++++++++------
  1 files changed, 8 insertions(+), 6 deletions(-)


diff --git a/Lib/os.py b/Lib/os.py
--- a/Lib/os.py
+++ b/Lib/os.py
@@ -686,19 +686,16 @@
             self[key] = value
         return self[key]
 
+# if putenv or unsetenv exist they should already be in __all__
 try:
     _putenv = putenv
 except NameError:
     _putenv = lambda key, value: None
-else:
-    __all__.append("putenv")
 
 try:
     _unsetenv = unsetenv
 except NameError:
     _unsetenv = lambda key: _putenv(key, "")
-else:
-    __all__.append("unsetenv")
 
 def _createenviron():
     if name == 'nt':
@@ -883,6 +880,10 @@
 otherwise return -SIG, where SIG is the signal that killed it. """
         return _spawnvef(mode, file, args, env, execvpe)
 
+
+    __all__.extend(["spawnv", "spawnve", "spawnvp", "spawnvpe"])
+
+
 if _exists("spawnv"):
     # These aren't supplied by the basic Windows code
     # but can be easily implemented in Python
@@ -908,7 +909,7 @@
         return spawnve(mode, file, args[:-1], env)
 
 
-    __all__.extend(["spawnv", "spawnve", "spawnl", "spawnle",])
+    __all__.extend(["spawnl", "spawnle"])
 
 
 if _exists("spawnvp"):
@@ -936,7 +937,8 @@
         return spawnvpe(mode, file, args[:-1], env)
 
 
-    __all__.extend(["spawnvp", "spawnvpe", "spawnlp", "spawnlpe",])
+    __all__.extend(["spawnlp", "spawnlpe"])
+
 
 import copyreg as _copyreg
 

-- 
Repository URL: http://hg.python.org/cpython


More information about the Python-checkins mailing list