summaryrefslogtreecommitdiffstats
path: root/Modules/atexitmodule.c
diff options
context:
space:
mode:
authorSerhiy Storchaka <storchaka@gmail.com>2017-06-12 05:25:04 (GMT)
committerGitHub <noreply@github.com>2017-06-12 05:25:04 (GMT)
commit3fd54d4a7e604067e2bc0f8cfd58bdbdc09fa7f4 (patch)
treea36010810577629101ec074cf56a5c9d307acda3 /Modules/atexitmodule.c
parent1dbce04d0e3e93b715eb0d8024da396361759d16 (diff)
downloadcpython-3fd54d4a7e604067e2bc0f8cfd58bdbdc09fa7f4.zip
cpython-3fd54d4a7e604067e2bc0f8cfd58bdbdc09fa7f4.tar.gz
cpython-3fd54d4a7e604067e2bc0f8cfd58bdbdc09fa7f4.tar.bz2
bpo-28994: Fixed errors handling in atexit._run_exitfuncs(). (#2034)
The traceback no longer displayed for SystemExit raised in a callback registered by atexit.
Diffstat (limited to 'Modules/atexitmodule.c')
-rw-r--r--Modules/atexitmodule.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/Modules/atexitmodule.c b/Modules/atexitmodule.c
index 3cdf2d7..35ebf08 100644
--- a/Modules/atexitmodule.c
+++ b/Modules/atexitmodule.c
@@ -97,7 +97,7 @@ atexit_callfuncs(void)
Py_XDECREF(exc_tb);
}
PyErr_Fetch(&exc_type, &exc_value, &exc_tb);
- if (!PyErr_ExceptionMatches(PyExc_SystemExit)) {
+ if (!PyErr_GivenExceptionMatches(exc_type, PyExc_SystemExit)) {
PySys_WriteStderr("Error in atexit._run_exitfuncs:\n");
PyErr_NormalizeException(&exc_type, &exc_value, &exc_tb);
PyErr_Display(exc_type, exc_value, exc_tb);