diff options
Diffstat (limited to 'Modules/_threadmodule.c')
-rw-r--r-- | Modules/_threadmodule.c | 18 |
1 files changed, 4 insertions, 14 deletions
diff --git a/Modules/_threadmodule.c b/Modules/_threadmodule.c index 680e8ca710..2b1a98f81b 100644 --- a/Modules/_threadmodule.c +++ b/Modules/_threadmodule.c @@ -1002,25 +1002,15 @@ t_bootstrap(void *boot_raw) res = PyObject_Call(boot->func, boot->args, boot->keyw); if (res == NULL) { if (PyErr_ExceptionMatches(PyExc_SystemExit)) + /* SystemExit is ignored silently */ PyErr_Clear(); else { - PyObject *file; - PyObject *exc, *value, *tb; - PySys_WriteStderr( - "Unhandled exception in thread started by "); - PyErr_Fetch(&exc, &value, &tb); - file = _PySys_GetObjectId(&PyId_stderr); - if (file != NULL && file != Py_None) - PyFile_WriteObject(boot->func, file, 0); - else - PyObject_Print(boot->func, stderr, 0); - PySys_WriteStderr("\n"); - PyErr_Restore(exc, value, tb); - PyErr_PrintEx(0); + _PyErr_WriteUnraisableMsg("in thread started by", boot->func); } } - else + else { Py_DECREF(res); + } Py_DECREF(boot->func); Py_DECREF(boot->args); Py_XDECREF(boot->keyw); |