Skip to content

Commit

Permalink
Remove assertion that globals must == locals in is_lazy_imports_active()
Browse files Browse the repository at this point in the history
Summary: Once assertions are enabled in libpython for CinderX dev builds in D64501543, we start seeing this assertion fire in tests. It typically comes up when using Python `exec()` with explicitly specified locals/globals.

Reviewed By: Kronuz, SonicField

Differential Revision: D64511886

fbshipit-source-id: 332ffa20953d0dada2cb12e6f0e4481f67f50724
  • Loading branch information
jbower-fb authored and facebook-github-bot committed Oct 18, 2024
1 parent eec7368 commit 9a5635b
Showing 1 changed file with 0 additions and 1 deletion.
1 change: 0 additions & 1 deletion Python/import.c
Original file line number Diff line number Diff line change
Expand Up @@ -4591,7 +4591,6 @@ _imp__set_lazy_imports_in_module_impl(PyObject *module, PyObject *enabled)
static int
is_lazy_imports_active(PyInterpreterState *interp, _PyInterpreterFrame *frame)
{
assert(frame->f_globals == frame->f_locals); /* only for module frames */
int lazy_imports = interp->lazy_imports;
if (lazy_imports) {
if (PyDict_CheckExact(frame->f_globals)) {
Expand Down

0 comments on commit 9a5635b

Please sign in to comment.