summaryrefslogtreecommitdiffstats
path: root/Modules/faulthandler.c
diff options
context:
space:
mode:
authorVictor Stinner <victor.stinner@gmail.com>2013-09-08 09:36:23 (GMT)
committerVictor Stinner <victor.stinner@gmail.com>2013-09-08 09:36:23 (GMT)
commit88983500767e3bd042170552c12f9f5280dd4b3a (patch)
tree8dd4b67c6e2a38e8ac5ed965aa6b1fbede657fe8 /Modules/faulthandler.c
parent9437d7a7fe81a5f80122d8c86ac469d20259eeea (diff)
downloadcpython-88983500767e3bd042170552c12f9f5280dd4b3a.zip
cpython-88983500767e3bd042170552c12f9f5280dd4b3a.tar.gz
cpython-88983500767e3bd042170552c12f9f5280dd4b3a.tar.bz2
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 172945d..47bc9e8 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();