summaryrefslogtreecommitdiff
path: root/Lib
diff options
context:
space:
mode:
authorSteve Dower <steve.dower@python.org>2019-06-28 10:02:13 -0700
committerNed Deily <nad@python.org>2019-07-01 22:24:26 -0400
commit3c34ea97a341e4dd80b542c99c593f014a8ae410 (patch)
tree0c65fde80bdd1fb2fe7f9613cada893d15bfd180 /Lib
parentcc0bf97d61fbe844843f28abc510a11f3ef09942 (diff)
downloadcpython-git-3c34ea97a341e4dd80b542c99c593f014a8ae410.tar.gz
bpo-37369: Fixes path for sys.executable when running from the Microsoft Store (GH-14450)
Diffstat (limited to 'Lib')
-rw-r--r--Lib/site.py7
-rw-r--r--Lib/test/test_venv.py8
-rw-r--r--Lib/venv/__init__.py2
3 files changed, 3 insertions, 14 deletions
diff --git a/Lib/site.py b/Lib/site.py
index ad1146332b..878658827c 100644
--- a/Lib/site.py
+++ b/Lib/site.py
@@ -458,13 +458,6 @@ def venv(known_paths):
env = os.environ
if sys.platform == 'darwin' and '__PYVENV_LAUNCHER__' in env:
executable = sys._base_executable = os.environ['__PYVENV_LAUNCHER__']
- elif sys.platform == 'win32' and '__PYVENV_LAUNCHER__' in env:
- executable = sys.executable
- import _winapi
- sys._base_executable = _winapi.GetModuleFileName(0)
- # bpo-35873: Clear the environment variable to avoid it being
- # inherited by child processes.
- del os.environ['__PYVENV_LAUNCHER__']
else:
executable = sys.executable
exe_dir, _ = os.path.split(os.path.abspath(executable))
diff --git a/Lib/test/test_venv.py b/Lib/test/test_venv.py
index a8dc59cb81..c3ccb92913 100644
--- a/Lib/test/test_venv.py
+++ b/Lib/test/test_venv.py
@@ -127,10 +127,6 @@ class BasicTest(BaseTest):
"""
Test that the prefix values are as expected.
"""
- #check our prefixes
- self.assertEqual(sys.base_prefix, sys.prefix)
- self.assertEqual(sys.base_exec_prefix, sys.exec_prefix)
-
# check a venv's prefixes
rmtree(self.env_dir)
self.run_with_capture(venv.create, self.env_dir)
@@ -139,8 +135,8 @@ class BasicTest(BaseTest):
for prefix, expected in (
('prefix', self.env_dir),
('prefix', self.env_dir),
- ('base_prefix', sys.prefix),
- ('base_exec_prefix', sys.exec_prefix)):
+ ('base_prefix', sys.base_prefix),
+ ('base_exec_prefix', sys.base_exec_prefix)):
cmd[2] = 'import sys; print(sys.%s)' % prefix
out, err = check_output(cmd)
self.assertEqual(out.strip(), expected.encode())
diff --git a/Lib/venv/__init__.py b/Lib/venv/__init__.py
index 7836dfba04..95c05486af 100644
--- a/Lib/venv/__init__.py
+++ b/Lib/venv/__init__.py
@@ -243,7 +243,7 @@ class EnvBuilder:
for suffix in suffixes:
src = os.path.join(dirname, suffix)
- if os.path.exists(src):
+ if os.path.lexists(src):
copier(src, os.path.join(binpath, suffix))
if sysconfig.is_python_build(True):