summaryrefslogtreecommitdiffstats
path: root/Objects/frameobject.c
diff options
context:
space:
mode:
authorBrandt Bucher <brandtbucher@microsoft.com>2023-01-09 20:20:04 (GMT)
committerGitHub <noreply@github.com>2023-01-09 20:20:04 (GMT)
commit61762b93871419b34f02d83cee5ca0d94d4a2903 (patch)
tree286b9aff961b5435e2d34894857a603ae86aa5c6 /Objects/frameobject.c
parent2e80c2a976c13dcb69a654b386164dca362295a3 (diff)
downloadcpython-61762b93871419b34f02d83cee5ca0d94d4a2903.zip
cpython-61762b93871419b34f02d83cee5ca0d94d4a2903.tar.gz
cpython-61762b93871419b34f02d83cee5ca0d94d4a2903.tar.bz2
GH-100126: Skip incomplete frames in more places (GH-100613)
Diffstat (limited to 'Objects/frameobject.c')
-rw-r--r--Objects/frameobject.c4
1 files changed, 1 insertions, 3 deletions
diff --git a/Objects/frameobject.c b/Objects/frameobject.c
index ebe3bfe..39ccca7 100644
--- a/Objects/frameobject.c
+++ b/Objects/frameobject.c
@@ -1405,9 +1405,7 @@ PyFrame_GetBack(PyFrameObject *frame)
PyFrameObject *back = frame->f_back;
if (back == NULL) {
_PyInterpreterFrame *prev = frame->f_frame->previous;
- while (prev && _PyFrame_IsIncomplete(prev)) {
- prev = prev->previous;
- }
+ prev = _PyFrame_GetFirstComplete(prev);
if (prev) {
back = _PyFrame_GetFrameObject(prev);
}