mirror of
https://github.com/python/cpython.git
synced 2025-07-24 03:35:53 +00:00
bpo-39947: Add PyInterpreterState_Get() function (GH-18979)
* Rename _PyInterpreterState_Get() to PyInterpreterState_Get() and move it the limited C API. * Add _PyInterpreterState_Get() alias to PyInterpreterState_Get() for backward compatibility with Python 3.8.
This commit is contained in:
parent
ff4584caca
commit
be79373a78
8 changed files with 35 additions and 14 deletions
|
@ -1072,6 +1072,18 @@ All of the following functions must be called after :c:func:`Py_Initialize`.
|
|||
to :c:func:`PyThreadState_Clear`.
|
||||
|
||||
|
||||
.. c:function:: PyInterpreterState* PyInterpreterState_Get(void)
|
||||
|
||||
Get the current interpreter.
|
||||
|
||||
Issue a fatal error if there no current Python thread state or no current
|
||||
interpreter. It cannot return NULL.
|
||||
|
||||
The caller must hold the GIL.
|
||||
|
||||
.. versionadded:: 3.9
|
||||
|
||||
|
||||
.. c:function:: PY_INT64_T PyInterpreterState_GetID(PyInterpreterState *interp)
|
||||
|
||||
Return the interpreter's unique ID. If there was any error in doing
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue