mirror of
https://github.com/python/cpython.git
synced 2025-08-04 00:48:58 +00:00
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.
This commit is contained in:
parent
2ebd3813af
commit
caba55b3b7
22 changed files with 107 additions and 93 deletions
|
@ -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);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue