diff options
author | Ronald Oussoren <ronaldoussoren@mac.com> | 2020-03-22 19:31:46 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-03-22 14:31:46 -0400 |
commit | 044cf94f610e831464a69a8e713dad89878824ce (patch) | |
tree | 622bf157b4a4202667aec282484eb305b090c7b7 /Lib/test/test_venv.py | |
parent | 05e4a296ecc127641160a04f39cc02c0f66a8c27 (diff) | |
download | cpython-git-044cf94f610e831464a69a8e713dad89878824ce.tar.gz |
bpo-22490: Remove __PYVENV_LAUNCHER__ from environment during launch (GH-9516)
* bpo-22490: Remove "__PYVENV_LAUNCHER__" from the shell environment on macOS
This changeset removes the environment varialbe "__PYVENV_LAUNCHER__"
during interpreter launch as it is only needed to communicate between
the stub executable in framework installs and the actual interpreter.
Leaving the environment variable present may lead to misbehaviour when
launching other scripts.
* Actually commit the changes for issue 22490...
* Correct typo
Co-Authored-By: Nicola Soranzo <nicola.soranzo@gmail.com>
* Run make patchcheck
Co-authored-by: Jason R. Coombs <jaraco@jaraco.com>
Co-authored-by: Nicola Soranzo <nicola.soranzo@gmail.com>
Diffstat (limited to 'Lib/test/test_venv.py')
-rw-r--r-- | Lib/test/test_venv.py | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/Lib/test/test_venv.py b/Lib/test/test_venv.py index a3b78c4e44..b2794cd992 100644 --- a/Lib/test/test_venv.py +++ b/Lib/test/test_venv.py @@ -391,6 +391,18 @@ class BasicTest(BaseTest): self.assertEqual(err, "".encode()) + @unittest.skipUnless(sys.platform == 'darwin', 'only relevant on macOS') + def test_macos_env(self): + rmtree(self.env_dir) + builder = venv.EnvBuilder() + builder.create(self.env_dir) + + envpy = os.path.join(os.path.realpath(self.env_dir), + self.bindir, self.exe) + out, err = check_output([envpy, '-c', + 'import os; print("__PYVENV_LAUNCHER__" in os.environ)']) + self.assertEqual(out.strip(), 'False'.encode()) + @requireVenvCreate class EnsurePipTest(BaseTest): """Test venv module installation of pip.""" |