Skip to content

Commit 79356fd

Browse files
Commit
1 parent addfa2b commit 79356fd

File tree

2 files changed

+8
-1
lines changed

2 files changed

+8
-1
lines changed

Doc/c-api/sys.rst

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -130,8 +130,15 @@ Operating System Utilities
130130
Returns ``1`` if a :c:macro:`!SIGINT` has occurred and clears the signal flag,
131131
or ``0`` otherwise.
132132
133+
This function is async-signal-safe.
133134
The caller must hold an :term:`attached thread state`.
134135
136+
In most cases, you should prefer :c:func:`PyErr_CheckSignals` over this function.
137+
:c:func:`!PyErr_CheckSignals` invokes the appropriate signal handlers
138+
for all pending signals, allowing Python code to handle the signal properly.
139+
This function only detects :c:macro:`!SIGINT` and does not invoke any Python
140+
signal handlers.
141+
135142
136143
.. c:function:: wchar_t* Py_DecodeLocale(const char* arg, size_t *size)
137144

Modules/signalmodule.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2025,7 +2025,7 @@ _PyOS_InterruptOccurred(PyThreadState *tstate)
20252025
}
20262026

20272027

2028-
// The caller must hold the GIL
2028+
// The caller must to hold the GIL
20292029
int
20302030
PyOS_InterruptOccurred(void)
20312031
{

0 commit comments

Comments
 (0)