mirror of
https://github.com/python/cpython.git
synced 2025-11-01 02:38:53 +00:00
gh-108867: Add PyThreadState_GetUnchecked() function (#108870)
Add PyThreadState_GetUnchecked() function: similar to PyThreadState_Get(), but don't issue a fatal error if it is NULL. The caller is responsible to check if the result is NULL. Previously, this function was private and known as _PyThreadState_UncheckedGet().
This commit is contained in:
parent
6ab6040054
commit
d73501602f
10 changed files with 34 additions and 8 deletions
|
|
@ -870,6 +870,19 @@ code, or when embedding the Python interpreter:
|
|||
When the current thread state is ``NULL``, this issues a fatal error (so that
|
||||
the caller needn't check for ``NULL``).
|
||||
|
||||
See also :c:func:`PyThreadState_GetUnchecked`.
|
||||
|
||||
|
||||
.. c:function:: PyThreadState* PyThreadState_GetUnchecked()
|
||||
|
||||
Similar to :c:func:`PyThreadState_Get`, but don't kill the process with a
|
||||
fatal error if it is NULL. The caller is responsible to check if the result
|
||||
is NULL.
|
||||
|
||||
.. versionadded:: 3.13
|
||||
In Python 3.5 to 3.12, the function was private and known as
|
||||
``_PyThreadState_UncheckedGet()``.
|
||||
|
||||
|
||||
.. c:function:: PyThreadState* PyThreadState_Swap(PyThreadState *tstate)
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue