mirror of
https://github.com/python/cpython.git
synced 2025-12-08 06:10:17 +00:00
[3.10] bpo-44838: Refine the custom syntax errors for invalid 'if' expressions (GH-27615). (GH-27616)
…
(cherry picked from commit f5cbea6b1b)
Co-authored-by: Pablo Galindo Salgado <Pablogsal@gmail.com>
Automerge-Triggered-By: GH:lysnikolaou
This commit is contained in:
parent
536e35ae6a
commit
b1bd16c252
4 changed files with 1370 additions and 1303 deletions
|
|
@ -152,6 +152,14 @@
|
|||
Traceback (most recent call last):
|
||||
SyntaxError: expected 'else' after 'if' expression
|
||||
|
||||
>>> if True:
|
||||
... print("Hello"
|
||||
...
|
||||
... if 2:
|
||||
... print(123))
|
||||
Traceback (most recent call last):
|
||||
SyntaxError: invalid syntax
|
||||
|
||||
>>> True = True = 3
|
||||
Traceback (most recent call last):
|
||||
SyntaxError: cannot assign to True
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue