summaryrefslogtreecommitdiff
path: root/Python/sysmodule.c
diff options
context:
space:
mode:
authorBrandt Bucher <brandtbucher@microsoft.com>2023-01-09 12:20:04 -0800
committerGitHub <noreply@github.com>2023-01-09 12:20:04 -0800
commit61762b93871419b34f02d83cee5ca0d94d4a2903 (patch)
tree286b9aff961b5435e2d34894857a603ae86aa5c6 /Python/sysmodule.c
parent2e80c2a976c13dcb69a654b386164dca362295a3 (diff)
downloadcpython-git-61762b93871419b34f02d83cee5ca0d94d4a2903.tar.gz
GH-100126: Skip incomplete frames in more places (GH-100613)
Diffstat (limited to 'Python/sysmodule.c')
-rw-r--r--Python/sysmodule.c5
1 files changed, 1 insertions, 4 deletions
diff --git a/Python/sysmodule.c b/Python/sysmodule.c
index 3f0baf9889..acee794864 100644
--- a/Python/sysmodule.c
+++ b/Python/sysmodule.c
@@ -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;
}
}