gh-101517: fix line number propagation in code generated for except* by iritkatriel · Pull Request #103550 · python/cpython
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks good as a backportable fix for the immediate issue.
As a longer-term follow-up, we should at the very least add asserts in the compiler to guarantee the line-number invariants we are supposed to provide (per PEP 626) rather than only catching issues downstream as in this case. (And possibly also adjust the compiler to automatically apply the restructuring done by this diff in cases where it's necessary to meet those invariants.)
Do you already have an issue for those follow-ups? If not, let's create one?