Skip to content

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

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

Merged
merged 1 commit into from
Jan 20, 2022

Conversation

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