Skip to content

bpo-46441: Fix the caret position in some syntax errors in interactive mode#30718

Merged
pablogsal merged 1 commit into
python:mainfrom
pablogsal:bpo-46441
Jan 20, 2022
Merged

bpo-46441: Fix the caret position in some syntax errors in interactive mode#30718
pablogsal merged 1 commit into
python:mainfrom
pablogsal:bpo-46441

Conversation

@pablogsal
Copy link
Copy Markdown
Member

@pablogsal pablogsal commented Jan 20, 2022

@pablogsal pablogsal changed the title Fix the caret position in some syntax errors in interactive mode bpo-46441: Fix the caret position in some syntax errors in interactive mode Jan 20, 2022
@pablogsal
Copy link
Copy Markdown
Member Author

As this only happen in interactive mode, there is no easy way to add an automatic test for it. So manual testing is required:

❯ ./python.exe
Python 3.11.0a4+ (heads/main-dirty:263c0dd160, Jan 19 2022, 23:46:46) [Clang 12.0.0 (clang-1200.0.32.29)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> def f():
...     print(0)
...     return yield 42
  File "<stdin>", line 3
    return yield 42
           ^^^^^
SyntaxError: invalid syntax

@pablogsal pablogsal merged commit 650720a into python:main Jan 20, 2022
@pablogsal pablogsal deleted the bpo-46441 branch January 20, 2022 15:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants