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

@ -2491,7 +2491,7 @@
_PyFrame_SetStackPointer(frame, stack_pointer);
PyObject *l_v = _PyImport_LoadLazyImportTstate(tstate, res_o);
stack_pointer = _PyFrame_GetStackPointer(frame);
if (PyDict_SetItem(GLOBALS(), name, l_v) < 0) {
if (l_v != NULL && PyDict_SetItem(GLOBALS(), name, l_v) < 0) {
JUMP_TO_LABEL(error);
}
res_o = l_v;