Fix recursive lazy imports and error path in bytecodes.c

This commit is contained in:
Pablo Galindo Salgado 2025-09-23 19:20:36 +01:00 committed by Dino Viehland
parent f9880bfd5f
commit f3f5795e31
6 changed files with 18 additions and 6 deletions

View file

@ -316,6 +316,8 @@ struct _import_state {
PyObject *lazy_import_func;
int lazy_imports_mode;
PyObject *lazy_imports_filter;
/* Counter to prevent recursive lazy import creation */
int lazy_import_resolution_depth;
/* The global import lock. */
_PyRecursiveMutex lock;
/* diagnostic info in PyImport_ImportModuleLevelObject() */