summaryrefslogtreecommitdiffstats
path: root/Lib/site.py
diff options
context:
space:
mode:
authorSteve Dower <steve.dower@python.org>2019-06-29 17:34:11 (GMT)
committerGitHub <noreply@github.com>2019-06-29 17:34:11 (GMT)
commit9048c49322a5229ff99610aba35913ffa295ebb7 (patch)
treecaad6f4a3b44e547208ac70cc1746c4df349ac8f /Lib/site.py
parent80097e089ba22a42d804e65fbbcf35e5e49eed00 (diff)
downloadcpython-9048c49322a5229ff99610aba35913ffa295ebb7.zip
cpython-9048c49322a5229ff99610aba35913ffa295ebb7.tar.gz
cpython-9048c49322a5229ff99610aba35913ffa295ebb7.tar.bz2
bpo-37369: Fix initialization of sys members when launched via an app container (GH-14428)
sys._base_executable is now always defined on all platforms, and can be overridden through configuration. Also adds test.support.PythonSymlink to encapsulate platform-specific logic for symlinking sys.executable
Diffstat (limited to 'Lib/site.py')
-rw-r--r--Lib/site.py7
1 files changed, 0 insertions, 7 deletions
diff --git a/Lib/site.py b/Lib/site.py
index e7aafb7..a065ab0 100644
--- a/Lib/site.py
+++ b/Lib/site.py
@@ -459,13 +459,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))