diff options
Diffstat (limited to 'Modules/faulthandler.c')
-rw-r--r-- | Modules/faulthandler.c | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/Modules/faulthandler.c b/Modules/faulthandler.c index 72dbe1e..46c2c42 100644 --- a/Modules/faulthandler.c +++ b/Modules/faulthandler.c @@ -854,7 +854,7 @@ faulthandler_fatal_error_py(PyObject *self, PyObject *args) } #if defined(HAVE_SIGALTSTACK) && defined(HAVE_SIGACTION) -void* +static void* stack_overflow(void *min_sp, void *max_sp, size_t *depth) { /* allocate 4096 bytes on the stack at each call */ @@ -1005,9 +1005,10 @@ static int faulthandler_env_options(void) { PyObject *xoptions, *key, *module, *res; - int enable; if (!Py_GETENV("PYTHONFAULTHANDLER")) { + int has_key; + xoptions = PySys_GetXOptions(); if (xoptions == NULL) return -1; @@ -1016,13 +1017,11 @@ faulthandler_env_options(void) if (key == NULL) return -1; - enable = PyDict_Contains(xoptions, key); + has_key = PyDict_Contains(xoptions, key); Py_DECREF(key); - if (!enable) + if (!has_key) return 0; } - else - enable = 1; module = PyImport_ImportModule("faulthandler"); if (module == NULL) { |