mirror of
https://github.com/python/cpython.git
synced 2025-12-04 08:34:25 +00:00
#14862: Add missing names to os.__all__
This commit is contained in:
parent
e02ba1031f
commit
3bc37f2360
2 changed files with 11 additions and 2 deletions
11
Lib/os.py
11
Lib/os.py
|
|
@ -30,8 +30,9 @@ _names = sys.builtin_module_names
|
||||||
|
|
||||||
# Note: more names are added to __all__ later.
|
# Note: more names are added to __all__ later.
|
||||||
__all__ = ["altsep", "curdir", "pardir", "sep", "pathsep", "linesep",
|
__all__ = ["altsep", "curdir", "pardir", "sep", "pathsep", "linesep",
|
||||||
"defpath", "name", "path", "devnull",
|
"defpath", "name", "path", "devnull", "SEEK_SET", "SEEK_CUR",
|
||||||
"SEEK_SET", "SEEK_CUR", "SEEK_END"]
|
"SEEK_END", "fsencode", "fsdecode", "get_exec_path", "fdopen",
|
||||||
|
"popen", "extsep"]
|
||||||
|
|
||||||
def _exists(name):
|
def _exists(name):
|
||||||
return name in globals()
|
return name in globals()
|
||||||
|
|
@ -50,6 +51,7 @@ if 'posix' in _names:
|
||||||
from posix import *
|
from posix import *
|
||||||
try:
|
try:
|
||||||
from posix import _exit
|
from posix import _exit
|
||||||
|
__all__.append('_exit')
|
||||||
except ImportError:
|
except ImportError:
|
||||||
pass
|
pass
|
||||||
import posixpath as path
|
import posixpath as path
|
||||||
|
|
@ -64,6 +66,7 @@ elif 'nt' in _names:
|
||||||
from nt import *
|
from nt import *
|
||||||
try:
|
try:
|
||||||
from nt import _exit
|
from nt import _exit
|
||||||
|
__all__.append('_exit')
|
||||||
except ImportError:
|
except ImportError:
|
||||||
pass
|
pass
|
||||||
import ntpath as path
|
import ntpath as path
|
||||||
|
|
@ -78,6 +81,7 @@ elif 'os2' in _names:
|
||||||
from os2 import *
|
from os2 import *
|
||||||
try:
|
try:
|
||||||
from os2 import _exit
|
from os2 import _exit
|
||||||
|
__all__.append('_exit')
|
||||||
except ImportError:
|
except ImportError:
|
||||||
pass
|
pass
|
||||||
if sys.version.find('EMX GCC') == -1:
|
if sys.version.find('EMX GCC') == -1:
|
||||||
|
|
@ -96,6 +100,7 @@ elif 'ce' in _names:
|
||||||
from ce import *
|
from ce import *
|
||||||
try:
|
try:
|
||||||
from ce import _exit
|
from ce import _exit
|
||||||
|
__all__.append('_exit')
|
||||||
except ImportError:
|
except ImportError:
|
||||||
pass
|
pass
|
||||||
# We can use the standard Windows path.
|
# We can use the standard Windows path.
|
||||||
|
|
@ -700,6 +705,8 @@ if _exists("fork") and not _exists("spawnv") and _exists("execv"):
|
||||||
P_WAIT = 0
|
P_WAIT = 0
|
||||||
P_NOWAIT = P_NOWAITO = 1
|
P_NOWAIT = P_NOWAITO = 1
|
||||||
|
|
||||||
|
__all__.extend(["P_WAIT", "P_NOWAIT", "P_NOWAITO"])
|
||||||
|
|
||||||
# XXX Should we support P_DETACH? I suppose it could fork()**2
|
# XXX Should we support P_DETACH? I suppose it could fork()**2
|
||||||
# and close the std I/O streams. Also, P_OVERLAY is the same
|
# and close the std I/O streams. Also, P_OVERLAY is the same
|
||||||
# as execv*()?
|
# as execv*()?
|
||||||
|
|
|
||||||
|
|
@ -42,6 +42,8 @@ Core and Builtins
|
||||||
Library
|
Library
|
||||||
-------
|
-------
|
||||||
|
|
||||||
|
- Issue #14862: Add missing names to os.__all__
|
||||||
|
|
||||||
- Issue #14875: Use float('inf') instead of float('1e66666') in the json module.
|
- Issue #14875: Use float('inf') instead of float('1e66666') in the json module.
|
||||||
|
|
||||||
- Issue #13585: Added contextlib.ExitStack
|
- Issue #13585: Added contextlib.ExitStack
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue