diff options
| author | Eric Snow <ericsnowcurrently@gmail.com> | 2021-12-08 01:56:06 (GMT) |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2021-12-08 01:56:06 (GMT) |
| commit | 758b74e71eb22e1e83a9eb937d1c015e461745a1 (patch) | |
| tree | 10eab2bb7eef9b653409593146c72f5d491f0dd3 /Python | |
| parent | 1f384e318481532323bb9076f4447bc02da07209 (diff) | |
| download | cpython-758b74e71eb22e1e83a9eb937d1c015e461745a1.zip cpython-758b74e71eb22e1e83a9eb937d1c015e461745a1.tar.gz cpython-758b74e71eb22e1e83a9eb937d1c015e461745a1.tar.bz2 | |
bpo-46008: Add _PyInterpreterState_Main(). (gh-29978)
PyInterpreterState_Main() is a plain function exposed in the public C-API. For internal usage we can take the more efficient approach in this PR.
https://bugs.python.org/issue46008
Diffstat (limited to 'Python')
| -rw-r--r-- | Python/pylifecycle.c | 2 | ||||
| -rw-r--r-- | Python/pystate.c | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/Python/pylifecycle.c b/Python/pylifecycle.c index f648dda..2b386a1 100644 --- a/Python/pylifecycle.c +++ b/Python/pylifecycle.c @@ -1953,7 +1953,7 @@ new_interpreter(PyThreadState **tstate_p, int isolated_subinterpreter) #endif { /* No current thread state, copy from the main interpreter */ - PyInterpreterState *main_interp = PyInterpreterState_Main(); + PyInterpreterState *main_interp = _PyInterpreterState_Main(); config = _PyInterpreterState_GetConfig(main_interp); } diff --git a/Python/pystate.c b/Python/pystate.c index f94019d..f21673e 100644 --- a/Python/pystate.c +++ b/Python/pystate.c @@ -1204,7 +1204,7 @@ PyInterpreterState_Head(void) PyInterpreterState * PyInterpreterState_Main(void) { - return _PyRuntime.interpreters.main; + return _PyInterpreterState_Main(); } PyInterpreterState * |
