diff options
author | 2019-06-29 10:34:11 -0700 | |
---|---|---|
committer | 2019-06-29 10:34:11 -0700 | |
commit | 9048c49322a5229ff99610aba35913ffa295ebb7 (patch) | |
tree | caad6f4a3b44e547208ac70cc1746c4df349ac8f /Lib/site.py | |
parent | bpo-19696: Moved "test_pkgimport.py" to dir "test_importlib" (GH-14303) (diff) | |
download | cpython-9048c49322a5229ff99610aba35913ffa295ebb7.tar.gz cpython-9048c49322a5229ff99610aba35913ffa295ebb7.tar.bz2 cpython-9048c49322a5229ff99610aba35913ffa295ebb7.zip |
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.py | 7 |
1 files changed, 0 insertions, 7 deletions
diff --git a/Lib/site.py b/Lib/site.py index e7aafb7011c..a065ab0b5db 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)) |