Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
PyOS_InterruptOccurred
  • Loading branch information
StanFromIreland committed Nov 13, 2025
commit addfa2b202634efa1b12e21b4d7a6954e1a98d75
10 changes: 10 additions & 0 deletions Doc/c-api/sys.rst
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,16 @@ Operating System Utilities
This is a thin wrapper around either :c:func:`!sigaction` or :c:func:`!signal`. Do
not call those functions directly!


.. c:function:: int PyOS_InterruptOccurred(void)

Check if a :c:macro:`!SIGINT` signal has been received.
Returns ``1`` if a :c:macro:`!SIGINT` has occurred and clears the signal flag,
or ``0`` otherwise.

The caller must hold an :term:`attached thread state`.


.. c:function:: wchar_t* Py_DecodeLocale(const char* arg, size_t *size)

.. warning::
Expand Down
2 changes: 1 addition & 1 deletion Modules/signalmodule.c
Original file line number Diff line number Diff line change
Expand Up @@ -2025,7 +2025,7 @@ _PyOS_InterruptOccurred(PyThreadState *tstate)
}


// The caller must to hold the GIL
// The caller must hold the GIL
int
PyOS_InterruptOccurred(void)
{
Expand Down
Loading