New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Make SyntaxError when mixing except/except* point to the offending clause #99211
Comments
|
How do we know which one is wrong? |
|
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. |
|
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. |
|
Correct. |
lysnikolaou
added a commit
to lysnikolaou/cpython
that referenced
this issue
Nov 7, 2022
lysnikolaou
added a commit
to lysnikolaou/cpython
that referenced
this issue
Nov 7, 2022
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
lysnikolaou commentedNov 7, 2022
•
edited by bedevere-bot
After #99160, the
SyntaxErrorpoints to thetrykeyword, but I think it would be relatively easy to make it point to theexceptorexcept*(whichever one is responsible for theSyntaxError) by extracting different alternatives. Do you think that pointing to thetryis good enough? @iritkatriel @pablogsalThe text was updated successfully, but these errors were encountered: