summaryrefslogtreecommitdiff
path: root/Python
diff options
context:
space:
mode:
authorVictor Stinner <vstinner@python.org>2020-03-13 18:15:33 +0100
committerGitHub <noreply@github.com>2020-03-13 18:15:33 +0100
commitbe79373a78c0d75fc715ab64253c9b757987a848 (patch)
tree9fba5caff3547b80fbfd2b468339458e7d5d0037 /Python
parentff4584caca04cb3da0dbd5b1e9bf67e40adf5312 (diff)
downloadcpython-git-be79373a78c0d75fc715ab64253c9b757987a848.tar.gz
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.
Diffstat (limited to 'Python')
-rw-r--r--Python/pystate.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/Python/pystate.c b/Python/pystate.c
index 9cf6bea1a0..28c5578664 100644
--- a/Python/pystate.c
+++ b/Python/pystate.c
@@ -396,7 +396,7 @@ _PyInterpreterState_DeleteExceptMain(_PyRuntimeState *runtime)
PyInterpreterState *
-_PyInterpreterState_Get(void)
+PyInterpreterState_Get(void)
{
PyThreadState *tstate = _PyThreadState_GET();
if (tstate == NULL) {
@@ -1423,9 +1423,9 @@ _check_xidata(_PyCrossInterpreterData *data)
int
_PyObject_GetCrossInterpreterData(PyObject *obj, _PyCrossInterpreterData *data)
{
- // _PyInterpreterState_Get() aborts if lookup fails, so we don't need
+ // PyInterpreterState_Get() aborts if lookup fails, so we don't need
// to check the result for NULL.
- PyInterpreterState *interp = _PyInterpreterState_Get();
+ PyInterpreterState *interp = PyInterpreterState_Get();
// Reset data before re-populating.
*data = (_PyCrossInterpreterData){0};