]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
SF 595846. Backport deltas from 1.26 to 1.28.
authorRaymond Hettinger <python@rcn.com>
Tue, 20 Aug 2002 23:59:33 +0000 (23:59 +0000)
committerRaymond Hettinger <python@rcn.com>
Tue, 20 Aug 2002 23:59:33 +0000 (23:59 +0000)
Lib/CGIHTTPServer.py

index 76570d25925e9ef8163e07dd69b11ded0480ed54..2106a5397260e96d733390e02da3c54458d4ea96 100644 (file)
@@ -182,6 +182,7 @@ class CGIHTTPRequestHandler(SimpleHTTPServer.SimpleHTTPRequestHandler):
             for k in ('QUERY_STRING', 'REMOTE_HOST', 'CONTENT_LENGTH',
                       'HTTP_USER_AGENT', 'HTTP_COOKIE'):
                 env.setdefault(k, "")
+        os.environ.update(env)
 
         self.send_response(200, "Script output follows")
 
@@ -221,7 +222,6 @@ class CGIHTTPRequestHandler(SimpleHTTPServer.SimpleHTTPRequestHandler):
                 popenx = os.popen3
             else:
                 popenx = os.popen2
-            os.environ.update(env)
             cmdline = scriptfile
             if self.is_python(scriptfile):
                 interp = sys.executable
@@ -259,7 +259,6 @@ class CGIHTTPRequestHandler(SimpleHTTPServer.SimpleHTTPRequestHandler):
 
         else:
             # Other O.S. -- execute script in this process
-            os.environ.update(env)
             save_argv = sys.argv
             save_stdin = sys.stdin
             save_stdout = sys.stdout