]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
[3.10] bpo-44273: Improve syntax error message for assigning to "..." (GH-26477)...
authorPablo Galindo <Pablogsal@gmail.com>
Thu, 3 Jun 2021 21:22:28 +0000 (22:22 +0100)
committerGitHub <noreply@github.com>
Thu, 3 Jun 2021 21:22:28 +0000 (22:22 +0100)
Use "ellipsis" instead of "Ellipsis" in syntax error messages to eliminate confusion with built-in variable Ellipsis.
(cherry picked from commit 39dd141)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
Lib/test/test_syntax.py
Parser/pegen.c

index cc189ef0f54b52a921208e6fc26fcb9484c8d4b9..c000028e5f1aaa0e3ada519f70b442dbfaf7fb1f 100644 (file)
@@ -93,7 +93,7 @@ SyntaxError: cannot assign to literal here. Maybe you meant '==' instead of '='?
 
 >>> ... = 1
 Traceback (most recent call last):
-SyntaxError: cannot assign to Ellipsis here. Maybe you meant '==' instead of '='?
+SyntaxError: cannot assign to ellipsis here. Maybe you meant '==' instead of '='?
 
 >>> `1` = 1
 Traceback (most recent call last):
index 548a64788dec4b86072d296e10706db7745d3c48..aac7e368a799f80d40ed02427c7fa18188f1cf27 100644 (file)
@@ -217,7 +217,7 @@ _PyPegen_get_expr_name(expr_ty e)
                 return "True";
             }
             if (value == Py_Ellipsis) {
-                return "Ellipsis";
+                return "ellipsis";
             }
             return "literal";
         }