mirror of
https://github.com/python/cpython.git
synced 2025-10-14 18:59:46 +00:00
Closes #28059: Fixes test_platform to set PYTHONPATH for .pyd files
This commit is contained in:
commit
c5111b5b1f
1 changed files with 3 additions and 2 deletions
|
@ -15,8 +15,8 @@ class PlatformTest(unittest.TestCase):
|
||||||
|
|
||||||
@support.skip_unless_symlink
|
@support.skip_unless_symlink
|
||||||
def test_architecture_via_symlink(self): # issue3762
|
def test_architecture_via_symlink(self): # issue3762
|
||||||
# On Windows, the EXE needs to know where pythonXY.dll is at so we have
|
# On Windows, the EXE needs to know where pythonXY.dll and *.pyd is at
|
||||||
# to add the directory to the path.
|
# so we add the directory to the path and PYTHONPATH.
|
||||||
if sys.platform == "win32":
|
if sys.platform == "win32":
|
||||||
def restore_environ(old_env):
|
def restore_environ(old_env):
|
||||||
os.environ.clear()
|
os.environ.clear()
|
||||||
|
@ -26,6 +26,7 @@ class PlatformTest(unittest.TestCase):
|
||||||
|
|
||||||
os.environ["Path"] = "{};{}".format(
|
os.environ["Path"] = "{};{}".format(
|
||||||
os.path.dirname(sys.executable), os.environ["Path"])
|
os.path.dirname(sys.executable), os.environ["Path"])
|
||||||
|
os.environ["PYTHONPATH"] = os.path.dirname(sys.executable)
|
||||||
|
|
||||||
def get(python):
|
def get(python):
|
||||||
cmd = [python, '-c',
|
cmd = [python, '-c',
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue