File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -15,11 +15,18 @@ def test_architecture(self):
1515
1616 @support .skip_unless_symlink
1717 def test_architecture_via_symlink (self ): # issue3762
18- # On Windows, the EXE needs to know where pythonXY.dll is at so we have
19- # to add the directory to the path.
18+ # On Windows, the EXE needs to know where pythonXY.dll and *.pyd is at
19+ # so we add the directory to the path and PYTHONPATH .
2020 if sys .platform == "win32" :
21+ def restore_environ (old_env ):
22+ os .environ .clear ()
23+ os .environ .update (old_env )
24+
25+ self .addCleanup (restore_environ , dict (os .environ ))
26+
2127 os .environ ["Path" ] = "{};{}" .format (
2228 os .path .dirname (sys .executable ), os .environ ["Path" ])
29+ os .environ ["PYTHONPATH" ] = os .path .dirname (sys .executable )
2330
2431 def get (python ):
2532 cmd = [python , '-c' ,
You can’t perform that action at this time.
0 commit comments