mirror of
https://github.com/python/cpython.git
synced 2025-08-04 17:08:35 +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
|
@ -28,6 +28,17 @@ PyAPI_FUNC(PyInterpreterState *) PyInterpreterState_New(void);
|
|||
PyAPI_FUNC(void) PyInterpreterState_Clear(PyInterpreterState *);
|
||||
PyAPI_FUNC(void) PyInterpreterState_Delete(PyInterpreterState *);
|
||||
|
||||
#if !defined(Py_LIMITED_API) || Py_LIMITED_API+0 >= 0x03090000
|
||||
/* New in 3.9 */
|
||||
/* Get the current interpreter state.
|
||||
|
||||
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. */
|
||||
PyAPI_FUNC(PyInterpreterState *) PyInterpreterState_Get(void);
|
||||
#endif
|
||||
|
||||
#if !defined(Py_LIMITED_API) || Py_LIMITED_API+0 >= 0x03080000
|
||||
/* New in 3.8 */
|
||||
PyAPI_FUNC(PyObject *) PyInterpreterState_GetDict(PyInterpreterState *);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue