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

@ -6223,11 +6223,12 @@
level = stack_pointer[-2];
PyObject *name = GETITEM(FRAME_CO_NAMES, oparg >> 2);
PyObject *res_o;
if (oparg & 0x01) {
if (!(oparg & 0x02)) {
_PyFrame_SetStackPointer(frame, stack_pointer);
res_o = _PyEval_LazyImportName(tstate, BUILTINS(), GLOBALS(), LOCALS(), name,
PyStackRef_AsPyObjectBorrow(fromlist),
PyStackRef_AsPyObjectBorrow(level));
PyStackRef_AsPyObjectBorrow(level),
oparg & 0x01);
stack_pointer = _PyFrame_GetStackPointer(frame);
} else {
_PyFrame_SetStackPointer(frame, stack_pointer);