From caba55b3b735405b280273f7d99866a046c18281 Mon Sep 17 00:00:00 2001 From: Victor Stinner Date: Fri, 3 Aug 2018 15:33:52 +0200 Subject: 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. --- Python/pylifecycle.c | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) (limited to 'Python/pylifecycle.c') diff --git a/Python/pylifecycle.c b/Python/pylifecycle.c index 95fb8616b5..c2ee4ffc46 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); -- cgit v1.2.1