From 3fd54d4a7e604067e2bc0f8cfd58bdbdc09fa7f4 Mon Sep 17 00:00:00 2001 From: Serhiy Storchaka Date: Mon, 12 Jun 2017 08:25:04 +0300 Subject: bpo-28994: Fixed errors handling in atexit._run_exitfuncs(). (#2034) The traceback no longer displayed for SystemExit raised in a callback registered by atexit. --- Modules/atexitmodule.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'Modules/atexitmodule.c') diff --git a/Modules/atexitmodule.c b/Modules/atexitmodule.c index 3cdf2d7e56..35ebf08ecd 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); -- cgit v1.2.1