mirror of
https://github.com/python/cpython.git
synced 2025-08-04 08:59:19 +00:00
GH-100126: Skip incomplete frames in more places (GH-100613)
This commit is contained in:
parent
2e80c2a976
commit
61762b9387
12 changed files with 62 additions and 46 deletions
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue