[issue46441] Caret points to wrong line on 'return yield 42' in REPL

2022-01-20 Thread Batuhan Taskaya


Batuhan Taskaya  added the comment:


New changeset 30fb6d073d9ca00dff8e4155c523cdfa63abab6b by Batuhan Taskaya in 
branch 'main':
bpo-46441: Add a boilerplate to test syntax errors in interactive mode 
(GH-30720)
https://github.com/python/cpython/commit/30fb6d073d9ca00dff8e4155c523cdfa63abab6b


--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue46441] Caret points to wrong line on 'return yield 42' in REPL

2022-01-20 Thread Guido van Rossum


Guido van Rossum  added the comment:

Thanks for the quick fix!

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue46441] Caret points to wrong line on 'return yield 42' in REPL

2022-01-20 Thread Batuhan Taskaya


Change by Batuhan Taskaya :


--
nosy: +BTaskaya
nosy_count: 3.0 -> 4.0
pull_requests: +28911
pull_request: https://github.com/python/cpython/pull/30720

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue46441] Caret points to wrong line on 'return yield 42' in REPL

2022-01-20 Thread Pablo Galindo Salgado


Pablo Galindo Salgado  added the comment:

Thanks for the bug report, Guido!

Everything should be ok now

--
resolution:  -> fixed
stage: patch review -> resolved
status: open -> closed

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue46441] Caret points to wrong line on 'return yield 42' in REPL

2022-01-20 Thread Pablo Galindo Salgado


Change by Pablo Galindo Salgado :


--
keywords: +patch
pull_requests: +28909
stage:  -> patch review
pull_request: https://github.com/python/cpython/pull/30718

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue46441] Caret points to wrong line on 'return yield 42' in REPL

2022-01-19 Thread Guido van Rossum


New submission from Guido van Rossum :

This seems to happen in 3.11 in the REPL only.

>>> def f():
...   print(0)
...   return yield 42
  File "", line 3
def f():
^
SyntaxError: invalid syntax

Note that running it from a file gives the expected output:

PS C:\Users\gvanrossum\cpython> py -3.10 .\t.py
  File "C:\Users\gvanrossum\cpython\t.py", line 3
return yield 42
   ^
SyntaxError: invalid syntax

as does the 3.10 REPL:

>>> def f():
...   print(0)
...   return yield 42
  File "", line 3
return yield 42
   ^
SyntaxError: invalid syntax

--
assignee: pablogsal
components: Parser
messages: 410988
nosy: gvanrossum, lys.nikolaou, pablogsal
priority: normal
severity: normal
status: open
title: Caret points to wrong line on 'return yield 42' in REPL
versions: Python 3.11

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com