summaryrefslogtreecommitdiffstats
path: root/Python/pylifecycle.c
diff options
context:
space:
mode:
authorVictor Stinner <vstinner@redhat.com>2018-08-03 13:33:52 (GMT)
committerGitHub <noreply@github.com>2018-08-03 13:33:52 (GMT)
commitcaba55b3b735405b280273f7d99866a046c18281 (patch)
tree3a98ac383b1fbab272158933255fb1a14107ebf6 /Python/pylifecycle.c
parent2ebd3813af9172fe1f9b2f6004edf6f1e1e5d9f1 (diff)
downloadcpython-caba55b3b735405b280273f7d99866a046c18281.zip
cpython-caba55b3b735405b280273f7d99866a046c18281.tar.gz
cpython-caba55b3b735405b280273f7d99866a046c18281.tar.bz2
bpo-34301: Add _PyInterpreterState_Get() helper function (GH-8592)
sys_setcheckinterval() now uses a local variable to parse arguments, before writing into interp->check_interval.
Diffstat (limited to 'Python/pylifecycle.c')
-rw-r--r--Python/pylifecycle.c6
1 files changed, 1 insertions, 5 deletions
diff --git a/Python/pylifecycle.c b/Python/pylifecycle.c
index 95fb861..c2ee4ff 100644
--- a/Python/pylifecycle.c
+++ b/Python/pylifecycle.c
@@ -2123,11 +2123,7 @@ _Py_FatalInitError(_PyInitError err)
/* For the atexit module. */
void _Py_PyAtExit(void (*func)(PyObject *), PyObject *module)
{
- PyThreadState *ts;
- PyInterpreterState *is;
-
- ts = PyThreadState_GET();
- is = ts->interp;
+ PyInterpreterState *is = _PyInterpreterState_Get();
/* Guard against API misuse (see bpo-17852) */
assert(is->pyexitfunc == NULL || is->pyexitfunc == func);