Crash report
Bug description:
This crashes from an assertion error, only when __lazy_import__ is called directly:
import sys
def li_filter(importing_module: str, imported_module: str, fromlist: tuple[str, ...]) -> bool:
return False
sys.set_lazy_imports_filter(li_filter)
__lazy_import__('wave')
Moved from LazyImportsCabal#45 (couldn't have transferred it).
The compiler would always put a LOAD_CONST (None) before any IMPORT_NAME for imports without from, which is why this crash never happens in a regular lazy import.
CPython versions tested on:
CPython main branch
Operating systems tested on:
No response
Linked PRs