Add lazy import filter

This commit is contained in:
Dino Viehland 2025-09-19 00:54:01 -07:00
parent 9eef03cc80
commit de281fd894
21 changed files with 343 additions and 11 deletions

View file

@ -2947,10 +2947,11 @@ dummy_func(
inst(IMPORT_NAME, (level, fromlist -- res)) {
PyObject *name = GETITEM(FRAME_CO_NAMES, oparg >> 2);
PyObject *res_o;
if (oparg & 0x01) {
if (!(oparg & 0x02)) {
res_o = _PyEval_LazyImportName(tstate, BUILTINS(), GLOBALS(), LOCALS(), name,
PyStackRef_AsPyObjectBorrow(fromlist),
PyStackRef_AsPyObjectBorrow(level));
PyStackRef_AsPyObjectBorrow(level),
oparg & 0x01);
} else {
res_o = _PyEval_ImportName(tstate, BUILTINS(), GLOBALS(), LOCALS(), name,