Skip to content
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

gh-99153: set location on SyntaxError for try with both except and except* #99160

Merged
merged 4 commits into from
Nov 6, 2022

Conversation

iritkatriel
Copy link
Member

@iritkatriel iritkatriel commented Nov 6, 2022

Fixes #99153.

I made it point to the try because we don't know which except or except* is incorrect.

% ./python.exe f.py 
  File "/Users/iritkatriel/src/cpython-1/f.py", line 4
    try:
    ^^^
SyntaxError: cannot have both 'except' and 'except*' on the same 'try'

Copy link
Member

@pablogsal pablogsal left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@iritkatriel iritkatriel merged commit 61b6c40 into python:main Nov 6, 2022
@miss-islington
Copy link
Contributor

Thanks @iritkatriel for the PR 🌮🎉.. I'm working now to backport this PR to: 3.11.
🐍🍒⛏🤖

@miss-islington
Copy link
Contributor

Sorry, @iritkatriel, I could not cleanly backport this to 3.11 due to a conflict.
Please backport using cherry_picker on command line.
cherry_picker 61b6c40b645bd8c8568f1646dc46580fa49d107a 3.11

@bedevere-bot
Copy link

GH-99168 is a backport of this pull request to the 3.11 branch.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
interpreter-core (Objects, Python, Grammar, and Parser dirs) type-bug An unexpected behavior, bug, or error
Projects
None yet
Development

Successfully merging this pull request may close these issues.

"SyntaxError: cannot have both 'except' and 'except*' on the same 'try'" traceback point to a confusing place
4 participants