diff options
Diffstat (limited to 'Python')
-rw-r--r-- | Python/ceval.c | 8 | ||||
-rw-r--r-- | Python/pystate.c | 3 |
2 files changed, 8 insertions, 3 deletions
diff --git a/Python/ceval.c b/Python/ceval.c index 20d0e1c..091b0eb 100644 --- a/Python/ceval.c +++ b/Python/ceval.c @@ -5113,9 +5113,11 @@ error: #endif /* Log traceback info. */ - PyFrameObject *f = _PyFrame_GetFrameObject(frame); - if (f != NULL) { - PyTraceBack_Here(f); + if (!_PyFrame_IsIncomplete(frame)) { + PyFrameObject *f = _PyFrame_GetFrameObject(frame); + if (f != NULL) { + PyTraceBack_Here(f); + } } if (tstate->c_tracefunc != NULL) { diff --git a/Python/pystate.c b/Python/pystate.c index a0d61d7..23e9d24 100644 --- a/Python/pystate.c +++ b/Python/pystate.c @@ -1406,6 +1406,9 @@ _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; + } if (frame == NULL) { continue; } |