diff options
author | Victor Stinner <victor.stinner@gmail.com> | 2013-09-08 11:36:23 +0200 |
---|---|---|
committer | Victor Stinner <victor.stinner@gmail.com> | 2013-09-08 11:36:23 +0200 |
commit | 0132506440982db5ab055481e4ada0d979c3ac37 (patch) | |
tree | e40337c2ab9cc1fb5bf53d1671cb9aa8c131bab8 /Modules/faulthandler.c | |
parent | 253999d31da66b478fe68dadad51e7e19302603b (diff) | |
download | cpython-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.c | 5 |
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(); |