mirror of
https://github.com/python/cpython.git
synced 2025-10-16 19:57:59 +00:00
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>
This commit is contained in:
parent
05e4a296ec
commit
044cf94f61
5 changed files with 34 additions and 1 deletions
|
@ -196,6 +196,15 @@ main(int argc, char **argv) {
|
|||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* The environment variable is used to pass the value of real_path
|
||||
* to the actual python interpreter, and is read by code in
|
||||
* Python/coreconfig.c.
|
||||
*
|
||||
* This way the real interpreter knows how the user invoked the
|
||||
* interpreter and can behave as if this launcher is the real
|
||||
* interpreter (looking for pyvenv configuration, ...)
|
||||
*/
|
||||
setenv("__PYVENV_LAUNCHER__", real_path, 1);
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue