diff options
author | Victor Stinner <victor.stinner@gmail.com> | 2013-07-01 22:14:56 (GMT) |
---|---|---|
committer | Victor Stinner <victor.stinner@gmail.com> | 2013-07-01 22:14:56 (GMT) |
commit | 8d3795474eb70d246ccd9dae23a784436238ed79 (patch) | |
tree | 81bf3822873c54d491ecd2b760a2d3e76bdded72 | |
parent | b9dbc7d6e1ad5700ed0084f63215db97a2c9bcbb (diff) | |
download | cpython-8d3795474eb70d246ccd9dae23a784436238ed79.zip cpython-8d3795474eb70d246ccd9dae23a784436238ed79.tar.gz cpython-8d3795474eb70d246ccd9dae23a784436238ed79.tar.bz2 |
Issue #18343: faulthandler.register() now keeps the previous signal handler
when the function is called twice, so faulthandler.unregister() restores
correctly the original signal handler.
-rw-r--r-- | Misc/NEWS | 4 | ||||
-rw-r--r-- | Modules/faulthandler.c | 3 |
2 files changed, 6 insertions, 1 deletions
@@ -41,6 +41,10 @@ Core and Builtins Library ------- +- Issue #18343: faulthandler.register() now keeps the previous signal handler + when the function is called twice, so faulthandler.unregister() restores + correctly the original signal handler. + - Issue #17097: Make multiprocessing ignore EINTR. - Issue #18339: Negative ints keys in unpickler.memo dict no longer cause a diff --git a/Modules/faulthandler.c b/Modules/faulthandler.c index 7e363f0..c86a27f 100644 --- a/Modules/faulthandler.c +++ b/Modules/faulthandler.c @@ -742,6 +742,8 @@ faulthandler_register_py(PyObject *self, PyErr_SetFromErrno(PyExc_OSError); return NULL; } + + user->previous = previous; } Py_XDECREF(user->file); @@ -750,7 +752,6 @@ faulthandler_register_py(PyObject *self, user->fd = fd; user->all_threads = all_threads; user->chain = chain; - user->previous = previous; user->interp = tstate->interp; user->enabled = 1; |