Ensure that early = are not matched by the parser as invalid comparisons (GH-25375)

This commit is contained in:
Pablo Galindo 2021-04-13 02:32:33 +01:00 committed by GitHub
parent c1a66bdd6f
commit d9151cb453
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 423 additions and 319 deletions

View file

@ -863,6 +863,11 @@ leading to spurious errors.
Traceback (most recent call last):
SyntaxError: cannot assign to attribute here. Maybe you meant '==' instead of '='?
Ensure that early = are not matched by the parser as invalid comparisons
>>> f(2, 4, x=34); {1,2 a}
Traceback (most recent call last):
SyntaxError: invalid syntax
Make sure that the old "raise X, Y[, Z]" form is gone:
>>> raise X, Y
Traceback (most recent call last):