GH-100126: Skip incomplete frames in more places (GH-100613)

This commit is contained in:
Brandt Bucher 2023-01-09 12:20:04 -08:00 committed by GitHub
parent 2e80c2a976
commit 61762b9387
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
12 changed files with 62 additions and 46 deletions

View file

@ -1884,13 +1884,10 @@ sys__getframe_impl(PyObject *module, int depth)
if (frame != NULL) {
while (depth > 0) {
frame = frame->previous;
frame = _PyFrame_GetFirstComplete(frame->previous);
if (frame == NULL) {
break;
}
if (_PyFrame_IsIncomplete(frame)) {
continue;
}
--depth;
}
}