8000 bpo-40826: PyOS_InterruptOccurred() requires GIL (GH-20578) · python/cpython@f279e5b · GitHub
[go: up one dir, main page]

Skip to content

Commit f279e5b

Browse files
committed
bpo-40826: PyOS_InterruptOccurred() requires GIL (GH-20578)
PyOS_InterruptOccurred() now fails with a fatal error if it is called with the GIL released. (cherry picked from commit cbe1296)
1 parent 859e131 commit f279e5b

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
:c:func:`PyOS_InterruptOccurred` now fails with a fatal error if it is
2+
called with the GIL released.

Modules/signalmodule.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1784,7 +1784,7 @@ PyOS_FiniInterrupts(void)
17841784
int
17851785
_PyOS_InterruptOccurred(PyThreadState *tstate)
17861786
{
1787-
assert(tstate != NULL);
1787+
_Py_EnsureTstateNotNULL(tstate);
17881788
if (!_Py_ThreadCanHandleSignals(tstate->interp)) {
17891789
return 0;
17901790
}

0 commit comments

Comments
 (0)
0