[Python-checkins] cpython (merge 3.6 -> default): Merge 3.6

victor.stinner python-checkins at python.org
Thu Jan 12 05:54:15 EST 2017


https://hg.python.org/cpython/rev/92f4b35d84d5
changeset:   106104:92f4b35d84d5
parent:      106098:2b7b203e3909
parent:      106103:730d1fe3b2f4
user:        Victor Stinner <victor.stinner at gmail.com>
date:        Thu Jan 12 11:53:20 2017 +0100
summary:
  Merge 3.6

files:
  Lib/test/support/script_helper.py |  25 +++++++++++++-----
  Lib/test/test_imaplib.py          |   2 +-
  2 files changed, 19 insertions(+), 8 deletions(-)


diff --git a/Lib/test/support/script_helper.py b/Lib/test/support/script_helper.py
--- a/Lib/test/support/script_helper.py
+++ b/Lib/test/support/script_helper.py
@@ -67,17 +67,28 @@
     elif not env_vars and not env_required:
         # ignore Python environment variables
         cmd_line.append('-E')
-    # Need to preserve the original environment, for in-place testing of
-    # shared library builds.
-    env = os.environ.copy()
+
+    # But a special flag that can be set to override -- in this case, the
+    # caller is responsible to pass the full environment.
+    if env_vars.pop('__cleanenv', None):
+        env = {}
+        if sys.platform == 'win32':
+            # Windows requires at least the SYSTEMROOT environment variable to
+            # start Python.
+            env['SYSTEMROOT'] = os.environ['SYSTEMROOT']
+
+        # Other interesting environment variables, not copied currently:
+        # COMSPEC, HOME, PATH, TEMP, TMPDIR, TMP.
+    else:
+        # Need to preserve the original environment, for in-place testing of
+        # shared library builds.
+        env = os.environ.copy()
+
     # set TERM='' unless the TERM environment variable is passed explicitly
     # see issues #11390 and #18300
     if 'TERM' not in env_vars:
         env['TERM'] = ''
-    # But a special flag that can be set to override -- in this case, the
-    # caller is responsible to pass the full environment.
-    if env_vars.pop('__cleanenv', None):
-        env = {}
+
     env.update(env_vars)
     cmd_line.extend(args)
     proc = subprocess.Popen(cmd_line, stdin=subprocess.PIPE,
diff --git a/Lib/test/test_imaplib.py b/Lib/test/test_imaplib.py
--- a/Lib/test/test_imaplib.py
+++ b/Lib/test/test_imaplib.py
@@ -477,7 +477,7 @@
 
 @unittest.skipUnless(ssl, "SSL not available")
 class NewIMAPSSLTests(NewIMAPTestsMixin, unittest.TestCase):
-    imap_class = imaplib.IMAP4_SSL
+    imap_class = IMAP4_SSL
     server_class = SecureTCPServer
 
     def test_ssl_raises(self):

-- 
Repository URL: https://hg.python.org/cpython


More information about the Python-checkins mailing list