-
-
Notifications
You must be signed in to change notification settings - Fork 31.9k
Make SyntaxError when mixing except/except* point to the offending clause #99211
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
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
miss-islington
pushed a commit
that referenced
this issue
Nov 20, 2022
…H-99215) Automerge-Triggered-By: GH:lysnikolaou
lysnikolaou
added a commit
to lysnikolaou/cpython
that referenced
this issue
Nov 20, 2022
…them (pythonGH-99215) Automerge-Triggered-By: GH:lysnikolaou (cherry picked from commit 9c4232a)
lysnikolaou
added a commit
that referenced
this issue
Nov 20, 2022
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
After #99160, the
SyntaxError
points to thetry
keyword, but I think it would be relatively easy to make it point to theexcept
orexcept*
(whichever one is responsible for theSyntaxError
) by extracting different alternatives. Do you think that pointing to thetry
is good enough? @iritkatriel @pablogsalThe text was updated successfully, but these errors were encountered: