mirror of
https://github.com/python/cpython.git
synced 2025-08-04 00:48:58 +00:00
Always define getenv(), as suggested by Guido. This means that os.getenv() is also defined for MacPython-OS9 (even though it doesn't actually do anything useful), and it shouldn't hurt on other platforms.
This commit is contained in:
parent
52941a8348
commit
b11ce9b96c
1 changed files with 5 additions and 5 deletions
10
Lib/os.py
10
Lib/os.py
|
@ -416,11 +416,11 @@ else:
|
|||
|
||||
environ = _Environ(environ)
|
||||
|
||||
def getenv(key, default=None):
|
||||
"""Get an environment variable, return None if it doesn't exist.
|
||||
The optional second argument can specify an alternate default."""
|
||||
return environ.get(key, default)
|
||||
__all__.append("getenv")
|
||||
def getenv(key, default=None):
|
||||
"""Get an environment variable, return None if it doesn't exist.
|
||||
The optional second argument can specify an alternate default."""
|
||||
return environ.get(key, default)
|
||||
__all__.append("getenv")
|
||||
|
||||
def _exists(name):
|
||||
try:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue