FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

gh-99153: set location on SyntaxError for try with both except and except* by iritkatriel · Pull Request #99160 · python/cpython · GitHub

/ cpython Public

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

Merged
iritkatriel merged 4 commits into
python:mainfrom
iritkatriel:gh-99153
Nov 6, 2022
Merged

gh-99153: set location on SyntaxError for try with both except and except*#99160
iritkatriel merged 4 commits into
python:mainfrom
iritkatriel:gh-99153

Conversation

iritkatriel commented Nov 6, 2022
edited
Loading

Copy link
Copy Markdown
Member

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'

pablogsal left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

LGTM

iritkatriel merged commit 61b6c40 into python:main Nov 6, 2022

Copy link
Copy Markdown
Contributor

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

Copy link
Copy Markdown
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

Copy link
Copy Markdown

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

This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
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


Back | FazBrowse Home | New Git URL