]> granicus.if.org Git - python/commitdiff
Assume the raw environ is always declared. (GH-8707)
authorBenjamin Peterson <benjamin@python.org>
Wed, 8 Aug 2018 04:51:12 +0000 (21:51 -0700)
committerGitHub <noreply@github.com>
Wed, 8 Aug 2018 04:51:12 +0000 (21:51 -0700)
posixmodule.c always declares environ, so don't bother catching a NameError in os.py.

Lib/os.py

index 499e6285618f212801d3690311badc739b824070..4b31e4dcc8add6dee4f3507aed9fa48f54dface7 100644 (file)
--- a/Lib/os.py
+++ b/Lib/os.py
@@ -525,12 +525,6 @@ if {open, stat} <= supports_dir_fd and {scandir, stat} <= supports_fd:
 
     __all__.append("fwalk")
 
-# Make sure os.environ exists, at least
-try:
-    environ
-except NameError:
-    environ = {}
-
 def execl(file, *args):
     """execl(file, *args)