You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Make SyntaxError when mixing except/except* point to the offending clause #99211
After #99160, the SyntaxError points to the try keyword, but I think it would be relatively easy to make it point to the except or except* (whichever one is responsible for the SyntaxError) by extracting different alternatives. Do you think that pointing to the try is good enough? @iritkatriel@pablogsal
Activity
iritkatriel commentedon Nov 7, 2022
How do we know which one is wrong?
lysnikolaou commentedon Nov 7, 2022
I'm not sure whether this would work, but I was thinking that we could do something like this:
I haven't tested it, but I can spend some time on it later today or early tomorrow to see if it'd work.
iritkatriel commentedon Nov 7, 2022
Yes, I guess this might be better than the try. Even if the first clause was the wrong one, this points to where the type flips.
lysnikolaou commentedon Nov 7, 2022
Correct.
pythongh-99211: Point to except/except* on syntax errors when mixing …
pythongh-99211: Point to except/except* on syntax errors when mixing …
gh-99211: Point to except/except* on syntax errors when mixing them (G…
pythongh-99211: Point to except/except* on syntax errors when mixing …
[3.11] gh-99211: Point to except/except* on syntax errors when mixing…