Add __lazy_import__, check sys.modules before import

This commit is contained in:
Dino Viehland 2025-09-18 14:30:29 -07:00
parent 1c691ea756
commit 3b0d745e73
18 changed files with 272 additions and 40 deletions

View file

@ -2948,7 +2948,7 @@ dummy_func(
PyObject *name = GETITEM(FRAME_CO_NAMES, oparg >> 2);
PyObject *res_o;
if (oparg & 0x01) {
res_o = _PyEval_LazyImportName(tstate, BUILTINS(), GLOBALS(), name,
res_o = _PyEval_LazyImportName(tstate, BUILTINS(), GLOBALS(), LOCALS(), name,
PyStackRef_AsPyObjectBorrow(fromlist),
PyStackRef_AsPyObjectBorrow(level));