Skip to content

Commit 31f1155

Browse files
committed
Only issue a fatal error for KeyboardInterrupt.
1 parent 0c08141 commit 31f1155

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

Python/pylifecycle.c

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2326,8 +2326,12 @@ make_pre_finalization_calls(PyThreadState *tstate, int subinterpreters)
23262326
// For debugging purposes, we emit a fatal error if someone
23272327
// CTRL^C'ed the process.
23282328
if (PyErr_CheckSignals()) {
2329+
int fatal = PyErr_ExceptionMatches(PyExc_KeyboardInterrupt);
23292330
PyErr_FormatUnraisable("Exception ignored while waiting on finalization guards");
2330-
Py_FatalError("Interrupted while waiting on finalization guard");
2331+
2332+
if (fatal) {
2333+
Py_FatalError("Interrupted while waiting on finalization guard");
2334+
}
23312335
}
23322336
}
23332337
}

0 commit comments

Comments
 (0)