mirror of
https://github.com/python/cpython.git
synced 2025-08-28 12:45:07 +00:00
Fix os.__all__ to is passes test___all__
This commit is contained in:
parent
577abe161d
commit
ad34ef8640
1 changed files with 8 additions and 6 deletions
14
Lib/os.py
14
Lib/os.py
|
@ -686,19 +686,16 @@ class _Environ(MutableMapping):
|
||||||
self[key] = value
|
self[key] = value
|
||||||
return self[key]
|
return self[key]
|
||||||
|
|
||||||
|
# if putenv or unsetenv exist they should already be in __all__
|
||||||
try:
|
try:
|
||||||
_putenv = putenv
|
_putenv = putenv
|
||||||
except NameError:
|
except NameError:
|
||||||
_putenv = lambda key, value: None
|
_putenv = lambda key, value: None
|
||||||
else:
|
|
||||||
__all__.append("putenv")
|
|
||||||
|
|
||||||
try:
|
try:
|
||||||
_unsetenv = unsetenv
|
_unsetenv = unsetenv
|
||||||
except NameError:
|
except NameError:
|
||||||
_unsetenv = lambda key: _putenv(key, "")
|
_unsetenv = lambda key: _putenv(key, "")
|
||||||
else:
|
|
||||||
__all__.append("unsetenv")
|
|
||||||
|
|
||||||
def _createenviron():
|
def _createenviron():
|
||||||
if name == 'nt':
|
if name == 'nt':
|
||||||
|
@ -883,6 +880,10 @@ If mode == P_WAIT return the process's exit code if it exits normally;
|
||||||
otherwise return -SIG, where SIG is the signal that killed it. """
|
otherwise return -SIG, where SIG is the signal that killed it. """
|
||||||
return _spawnvef(mode, file, args, env, execvpe)
|
return _spawnvef(mode, file, args, env, execvpe)
|
||||||
|
|
||||||
|
|
||||||
|
__all__.extend(["spawnv", "spawnve", "spawnvp", "spawnvpe"])
|
||||||
|
|
||||||
|
|
||||||
if _exists("spawnv"):
|
if _exists("spawnv"):
|
||||||
# These aren't supplied by the basic Windows code
|
# These aren't supplied by the basic Windows code
|
||||||
# but can be easily implemented in Python
|
# but can be easily implemented in Python
|
||||||
|
@ -908,7 +909,7 @@ otherwise return -SIG, where SIG is the signal that killed it. """
|
||||||
return spawnve(mode, file, args[:-1], env)
|
return spawnve(mode, file, args[:-1], env)
|
||||||
|
|
||||||
|
|
||||||
__all__.extend(["spawnv", "spawnve", "spawnl", "spawnle",])
|
__all__.extend(["spawnl", "spawnle"])
|
||||||
|
|
||||||
|
|
||||||
if _exists("spawnvp"):
|
if _exists("spawnvp"):
|
||||||
|
@ -936,7 +937,8 @@ otherwise return -SIG, where SIG is the signal that killed it. """
|
||||||
return spawnvpe(mode, file, args[:-1], env)
|
return spawnvpe(mode, file, args[:-1], env)
|
||||||
|
|
||||||
|
|
||||||
__all__.extend(["spawnvp", "spawnvpe", "spawnlp", "spawnlpe",])
|
__all__.extend(["spawnlp", "spawnlpe"])
|
||||||
|
|
||||||
|
|
||||||
import copyreg as _copyreg
|
import copyreg as _copyreg
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue