gh-88535: Improve syntax error for wrongly closed strings (#26633)

This commit is contained in:
Pablo Galindo Salgado 2025-02-13 01:30:20 +00:00 committed by GitHub
parent 56eda25633
commit 6fb5138776
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
6 changed files with 1098 additions and 930 deletions

View file

@ -312,6 +312,12 @@ SyntaxError: did you forget parentheses around the comprehension target?
Traceback (most recent call last):
SyntaxError: did you forget parentheses around the comprehension target?
# Incorrectly closed strings
>>> "The interesting object "The important object" is very important"
Traceback (most recent call last):
SyntaxError: invalid syntax. Is this intended to be part of the string?
# Missing commas in literals collections should not
# produce special error messages regarding missing
# parentheses, but about missing commas instead