cpython: 94563ec74e1d (original) (raw)
Mercurial > cpython
changeset 103580:94563ec74e1d 3.5
Closes #28059: Fixes test_platform to set PYTHONPATH for .pyd files [#28059]
Steve Dower steve.dower@microsoft.com | |
---|---|
date | Sat, 10 Sep 2016 12:19:42 -0700 |
parents | 9eb0f7762999 |
children | 3ec4feb52a5b 3ed2c0d55526 |
files | Lib/test/test_platform.py |
diffstat | 1 files changed, 9 insertions(+), 2 deletions(-)[+] [-] Lib/test/test_platform.py 11 |
line wrap: on
line diff
--- a/Lib/test/test_platform.py +++ b/Lib/test/test_platform.py @@ -15,11 +15,18 @@ class PlatformTest(unittest.TestCase): @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[](#l1.7)
# to add the directory to the path.[](#l1.8)
# On Windows, the EXE needs to know where pythonXY.dll and *.pyd is at[](#l1.9)
# so we add the directory to the path and PYTHONPATH.[](#l1.10) if sys.platform == "win32":[](#l1.11)
def restore_environ(old_env):[](#l1.12)
os.environ.clear()[](#l1.13)
os.environ.update(old_env)[](#l1.14)
self.addCleanup(restore_environ, dict(os.environ))[](#l1.16)
+ os.environ["Path"] = "{};{}".format( os.path.dirname(sys.executable), os.environ["Path"])
os.environ["PYTHONPATH"] = os.path.dirname(sys.executable)[](#l1.20)