mirror of
https://github.com/python/cpython.git
synced 2025-11-02 03:01:58 +00:00
bpo-40429: PyThreadState_GetFrame() returns a strong ref (GH-19781)
The PyThreadState_GetFrame() function now returns a strong reference to the frame.
This commit is contained in:
parent
37af21b667
commit
4386b9045e
7 changed files with 26 additions and 20 deletions
|
|
@ -1840,14 +1840,17 @@ _is_running(PyInterpreterState *interp)
|
|||
"interpreter has more than one thread");
|
||||
return -1;
|
||||
}
|
||||
|
||||
assert(!PyErr_Occurred());
|
||||
PyFrameObject *frame = PyThreadState_GetFrame(tstate);
|
||||
if (frame == NULL) {
|
||||
if (PyErr_Occurred() != NULL) {
|
||||
return -1;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
return (int)(frame->f_executing);
|
||||
|
||||
int executing = (int)(frame->f_executing);
|
||||
Py_DECREF(frame);
|
||||
|
||||
return executing;
|
||||
}
|
||||
|
||||
static int
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue