[Python-checkins] cpython (merge 3.5 -> default): Closes #28059: Fixes test_platform to set PYTHONPATH for .pyd files

steve.dower python-checkins at python.org
Sat Sep 10 15:25:23 EDT 2016


https://hg.python.org/cpython/rev/3ec4feb52a5b
changeset:   103581:3ec4feb52a5b
parent:      103579:c7b48798dbaa
parent:      103580:94563ec74e1d
user:        Steve Dower <steve.dower at microsoft.com>
date:        Sat Sep 10 12:25:07 2016 -0700
summary:
  Closes #28059: Fixes test_platform to set PYTHONPATH for .pyd files

files:
  Lib/test/test_platform.py |  5 +++--
  1 files changed, 3 insertions(+), 2 deletions(-)


diff --git a/Lib/test/test_platform.py b/Lib/test/test_platform.py
--- a/Lib/test/test_platform.py
+++ b/Lib/test/test_platform.py
@@ -15,8 +15,8 @@
 
     @support.skip_unless_symlink
     def test_architecture_via_symlink(self): # issue3762
-        # On Windows, the EXE needs to know where pythonXY.dll is at so we have
-        # to add the directory to the path.
+        # On Windows, the EXE needs to know where pythonXY.dll and *.pyd is at
+        # so we add the directory to the path and PYTHONPATH.
         if sys.platform == "win32":
             def restore_environ(old_env):
                 os.environ.clear()
@@ -26,6 +26,7 @@
 
             os.environ["Path"] = "{};{}".format(
                 os.path.dirname(sys.executable), os.environ["Path"])
+            os.environ["PYTHONPATH"] = os.path.dirname(sys.executable)
 
         def get(python):
             cmd = [python, '-c',

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


More information about the Python-checkins mailing list