summaryrefslogtreecommitdiffstats
path: root/Modules/threadmodule.c
diff options
context:
space:
mode:
Diffstat (limited to 'Modules/threadmodule.c')
-rw-r--r--Modules/threadmodule.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/Modules/threadmodule.c b/Modules/threadmodule.c
index 62ea660..876d5e2 100644
--- a/Modules/threadmodule.c
+++ b/Modules/threadmodule.c
@@ -429,7 +429,7 @@ t_bootstrap(void *boot_raw)
PySys_WriteStderr(
"Unhandled exception in thread started by ");
file = PySys_GetObject("stderr");
- if (file)
+ if (file != NULL && file != Py_None)
PyFile_WriteObject(boot->func, file, 0);
else
PyObject_Print(boot->func, stderr, 0);