diff options
author | Steve Dower <steve.dower@python.org> | 2019-06-29 21:28:59 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-06-29 21:28:59 (GMT) |
commit | 323e743d4879f1cd861d0b252775797fb7938755 (patch) | |
tree | cfaccee98a1695fabc022c04450b972e4f79071d /Lib/site.py | |
parent | 0cba121029bae0a891b02c493cb77633620701be (diff) | |
download | cpython-323e743d4879f1cd861d0b252775797fb7938755.zip cpython-323e743d4879f1cd861d0b252775797fb7938755.tar.gz cpython-323e743d4879f1cd861d0b252775797fb7938755.tar.bz2 |
bpo-37369: Fix initialization of sys members when launched via an app container (GH-14467)
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 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)) |