Chain import SystemError on unexpected exceptions

seberg · GitHub

Feature or enhancement

For functions, the SystemError chains an in-fly unexpected exceptions, for some import errors this is not the case.

Pitch

Chaining seems easy, and helps debugging since it is tricky to get back the original exception otherwise, and knowing the exception is often sufficient.

Linked PRs

gh-99947: Ensure unreported error is chained for SystemError during import #99946