diff --git a/Modules/threadmodule.c b/Modules/threadmodule.c index 97ab4e1375c..e0afde5ea9e 100644 --- a/Modules/threadmodule.c +++ b/Modules/threadmodule.c @@ -197,7 +197,7 @@ t_bootstrap(void *boot_raw) if (PyErr_ExceptionMatches(PyExc_SystemExit)) PyErr_Clear(); else { - fprintf(stderr, "Unhandled exception in thread:\n"); + PySys_WriteStderr("Unhandled exception in thread:\n"); PyErr_PrintEx(0); } }