summaryrefslogtreecommitdiff
path: root/Modules/faulthandler.c
diff options
context:
space:
mode:
authorVictor Stinner <victor.stinner@gmail.com>2013-09-08 11:36:23 +0200
committerVictor Stinner <victor.stinner@gmail.com>2013-09-08 11:36:23 +0200
commit0132506440982db5ab055481e4ada0d979c3ac37 (patch)
treee40337c2ab9cc1fb5bf53d1671cb9aa8c131bab8 /Modules/faulthandler.c
parent253999d31da66b478fe68dadad51e7e19302603b (diff)
downloadcpython-0132506440982db5ab055481e4ada0d979c3ac37.tar.gz
Close #18957: The PYTHONFAULTHANDLER environment variable now only enables the
faulthandler module if the variable is non-empty. Same behaviour than other variables like PYTHONDONTWRITEBYTECODE.
Diffstat (limited to 'Modules/faulthandler.c')
-rw-r--r--Modules/faulthandler.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/Modules/faulthandler.c b/Modules/faulthandler.c
index 172945d1a4..47bc9e8d3b 100644
--- a/Modules/faulthandler.c
+++ b/Modules/faulthandler.c
@@ -1048,8 +1048,11 @@ faulthandler_env_options(void)
{
PyObject *xoptions, *key, *module, *res;
_Py_IDENTIFIER(enable);
+ char *p;
- if (!Py_GETENV("PYTHONFAULTHANDLER")) {
+ if (!((p = Py_GETENV("PYTHONFAULTHANDLER")) && *p != '\0')) {
+ /* PYTHONFAULTHANDLER environment variable is missing
+ or an empty string */
int has_key;
xoptions = PySys_GetXOptions();