Bug report
Bug description:
This has been crashing in debug mode since the initial lazy import implementation:
import sys
import types
class Spec:
@property
def _initializing(self):
raise RuntimeError("boom")
module = types.ModuleType("cached_spec")
module.__spec__ = Spec()
module.attr = 1
sys.modules["cached_spec"] = module
# This line fails, but cannot be in a try block:
lazy from cached_spec import attr
python3.15d: /builddir/build/BUILD/python3.15-3.15.0_rc2-build/Python-3.15.0rc2/Python/generated_cases.c.h:7979: _PyEval_EvalFrameDefault: Assertion `!_PyErr_Occurred(tstate)' failed.
Aborted (core dumped) python3.15d /tmp/repro.py
CPython versions tested on:
3.15, CPython main branch
Operating systems tested on:
Linux
Linked PRs
Bug report
Bug description:
This has been crashing in debug mode since the initial lazy import implementation:
CPython versions tested on:
3.15, CPython main branch
Operating systems tested on:
Linux
Linked PRs