aboutsummaryrefslogtreecommitdiff
path: root/Mac
diff options
context:
space:
mode:
authorRonald Oussoren <ronaldoussoren@mac.com>2020-03-22 19:31:46 +0100
committerGitHub <noreply@github.com>2020-03-22 14:31:46 -0400
commit044cf94f610e831464a69a8e713dad89878824ce (patch)
tree622bf157b4a4202667aec282484eb305b090c7b7 /Mac
parentbpo-40024: Add PyModule_AddType() helper function (GH-19088) (diff)
downloadcpython-044cf94f610e831464a69a8e713dad89878824ce.tar.gz
cpython-044cf94f610e831464a69a8e713dad89878824ce.tar.bz2
cpython-044cf94f610e831464a69a8e713dad89878824ce.zip
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 'Mac')
-rw-r--r--Mac/Tools/pythonw.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/Mac/Tools/pythonw.c b/Mac/Tools/pythonw.c
index 1d2db383f94..c8bd3ba8d68 100644
--- a/Mac/Tools/pythonw.c
+++ b/Mac/Tools/pythonw.c
@@ -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);
}