summaryrefslogtreecommitdiffstats
path: root/Python/pystate.c
diff options
context:
space:
mode:
Diffstat (limited to 'Python/pystate.c')
-rw-r--r--Python/pystate.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/Python/pystate.c b/Python/pystate.c
index 01e54fc..44f55be 100644
--- a/Python/pystate.c
+++ b/Python/pystate.c
@@ -1649,6 +1649,11 @@ PyThreadState_Clear(PyThreadState *tstate)
"PyThreadState_Clear: warning: thread still has a frame\n");
}
+ if (verbose && tstate->current_exception != NULL) {
+ fprintf(stderr, "PyThreadState_Clear: warning: thread has an exception set\n");
+ _PyErr_Print(tstate);
+ }
+
/* At this point tstate shouldn't be used any more,
neither to run Python code nor for other uses.