Skip to content

Commit f922381

Browse files
Alex Malyshevfacebook-github-bot
Alex Malyshev
authored andcommitted
Account for frames with null globals in Lazy Imports 3.12
Summary: Seeing this happening in the wild. Reviewed By: DinoV Differential Revision: D71346596 fbshipit-source-id: c6e2243a9e934032aeb3f85c36d371495b671a39
1 parent 4d7a0ca commit f922381

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

Python/import.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -4607,7 +4607,7 @@ is_lazy_imports_active(PyThreadState *tstate, _PyInterpreterFrame *frame)
46074607
return 1;
46084608
}
46094609

4610-
if (!PyDict_CheckExact(frame->f_globals)) {
4610+
if (frame->f_globals == NULL || !PyDict_CheckExact(frame->f_globals)) {
46114611
return 0;
46124612
}
46134613

0 commit comments

Comments
 (0)