Andre Roberge <[email protected]> added the comment:
I suspect that the Python parser cannot easily be changed to given any other
message. Replace the colon by "else" and add one more closing parenthesis and
you have a valid Python program. So, is it a matter of an unclosed
parenthesis, or not using "else" ? ....
If you want possible additional help in such situations, you can try to use the
third-party package friendly-traceback which gives the following information
for this case (I put your code in a file named "ignore.py")
====
Traceback (most recent call last):
File "ignore.py", line 5
if 2:
^
SyntaxError: invalid syntax
A `SyntaxError` occurs when Python cannot understand your code.
Python could not understand the code in the file
'ignore.py'
beyond the location indicated by --> and ^.
2: if 1:
3: print(((123))
4:
-->5: if 2:
^
6: print(123)
I make an effort below to guess what caused the problem
but I might guess incorrectly.
The opening parenthesis `(` on line 3 is not closed.
3: print(((123))
^
----------
nosy: +aroberge
_______________________________________
Python tracker <[email protected]>
<https://bugs.python.org/issue42577>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe:
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com