]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
bpo-44273: Improve syntax error message for assigning to "..." (GH-26477)
authorSerhiy Storchaka <storchaka@gmail.com>
Tue, 1 Jun 2021 11:07:05 +0000 (14:07 +0300)
committerGitHub <noreply@github.com>
Tue, 1 Jun 2021 11:07:05 +0000 (12:07 +0100)
Use "ellipsis" instead of "Ellipsis" in syntax error messages to eliminate confusion with built-in variable Ellipsis.

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";
         }