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:
Jack Jansen 2003-01-08 16:33:40 +00:00
parent 52941a8348
commit b11ce9b96c
1 changed files with 5 additions and 5 deletions

View File

@ -416,11 +416,11 @@ else:
environ = _Environ(environ) environ = _Environ(environ)
def getenv(key, default=None): def getenv(key, default=None):
"""Get an environment variable, return None if it doesn't exist. """Get an environment variable, return None if it doesn't exist.
The optional second argument can specify an alternate default.""" The optional second argument can specify an alternate default."""
return environ.get(key, default) return environ.get(key, default)
__all__.append("getenv") __all__.append("getenv")
def _exists(name): def _exists(name):
try: try: