summaryrefslogtreecommitdiff
path: root/Python
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 /Python
parent05e4a296ecc127641160a04f39cc02c0f66a8c27 (diff)
downloadcpython-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 'Python')
-rw-r--r--Python/initconfig.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/Python/initconfig.c b/Python/initconfig.c
index 19070d2a3f..7bad36ef17 100644
--- a/Python/initconfig.c
+++ b/Python/initconfig.c
@@ -1139,6 +1139,17 @@ config_init_program_name(PyConfig *config)
if (_PyStatus_EXCEPTION(status)) {
return status;
}
+
+ /*
+ * This environment variable is used to communicate between
+ * the stub launcher and the real interpreter and isn't needed
+ * beyond this point.
+ *
+ * Clean up to avoid problems when launching other programs
+ * later on.
+ */
+ (void)unsetenv("__PYVENV_LAUNCHER__");
+
return _PyStatus_OK();
}
}