FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

gh-141004: Document `PyOS_InterruptOccurred` by StanFromIreland · Pull Request #141526 · python/cpython · GitHub

/ cpython Public
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension .rst  (1) All 1 file type selected
Viewed files
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Unified
Split
Hide whitespace
Diff view
Unified
Split
Hide whitespace
18 changes: 18 additions & 0 deletions Doc/c-api/sys.rst
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,24 @@ 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)
Comment thread
StanFromIreland marked this conversation as resolved.

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.
Comment thread
StanFromIreland marked this conversation as resolved.

In most cases, you should prefer :c:func:`PyErr_CheckSignals` over this function.
:c:func:`!PyErr_CheckSignals` invokes the appropriate signal handlers
for all pending signals, allowing Python code to handle the signal properly.
This function only detects :c:macro:`!SIGINT` and does not invoke any Python
signal handlers.

This function is async-signal-safe and this function cannot fail.
The caller must hold an :term:`attached thread state`.


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

.. warning::
Expand Down
Loading

Back | FazBrowse Home | New Git URL