summaryrefslogtreecommitdiffstats
path: root/Python/pystate.c
diff options
context:
space:
mode:
Diffstat (limited to 'Python/pystate.c')
-rw-r--r--Python/pystate.c9
1 files changed, 2 insertions, 7 deletions
diff --git a/Python/pystate.c b/Python/pystate.c
index f52fc38..f2f571f 100644
--- a/Python/pystate.c
+++ b/Python/pystate.c
@@ -1302,10 +1302,7 @@ PyFrameObject*
PyThreadState_GetFrame(PyThreadState *tstate)
{
assert(tstate != NULL);
- _PyInterpreterFrame *f = tstate->cframe->current_frame;
- while (f && _PyFrame_IsIncomplete(f)) {
- f = f->previous;
- }
+ _PyInterpreterFrame *f = _PyThreadState_GetFrame(tstate);
if (f == NULL) {
return NULL;
}
@@ -1431,9 +1428,7 @@ _PyThread_CurrentFrames(void)
PyThreadState *t;
for (t = i->threads.head; t != NULL; t = t->next) {
_PyInterpreterFrame *frame = t->cframe->current_frame;
- while (frame && _PyFrame_IsIncomplete(frame)) {
- frame = frame->previous;
- }
+ frame = _PyFrame_GetFirstComplete(frame);
if (frame == NULL) {
continue;
}