summaryrefslogtreecommitdiffstats
path: root/Lib
diff options
context:
space:
mode:
authorPablo Galindo <Pablogsal@gmail.com>2020-05-21 21:04:54 (GMT)
committerGitHub <noreply@github.com>2020-05-21 21:04:54 (GMT)
commit275d7e1080d0007a82965d1ac510abb0ae8d7821 (patch)
tree587960b1b926db994aed0f5f47c028db001aa56e /Lib
parentc817a1c4de1ff1f475776fd1fe8fe158695e53a5 (diff)
downloadcpython-275d7e1080d0007a82965d1ac510abb0ae8d7821.zip
cpython-275d7e1080d0007a82965d1ac510abb0ae8d7821.tar.gz
cpython-275d7e1080d0007a82965d1ac510abb0ae8d7821.tar.bz2
[3.9] bpo-40176: Improve error messages for trailing comma on from import (GH-20294) (GH-20302)
(cherry picked from commit 72e0aa2) Co-authored-by: Batuhan Taskaya <batuhanosmantaskaya@gmail.com>
Diffstat (limited to 'Lib')
-rw-r--r--Lib/test/test_syntax.py8
1 files changed, 8 insertions, 0 deletions
diff --git a/Lib/test/test_syntax.py b/Lib/test/test_syntax.py
index a82b444..6d9c4e4 100644
--- a/Lib/test/test_syntax.py
+++ b/Lib/test/test_syntax.py
@@ -641,6 +641,14 @@ SyntaxError: cannot assign to f-string expression
Traceback (most recent call last):
SyntaxError: cannot assign to f-string expression
+>>> from t import x,
+Traceback (most recent call last):
+SyntaxError: trailing comma not allowed without surrounding parentheses
+
+>>> from t import x,y,
+Traceback (most recent call last):
+SyntaxError: trailing comma not allowed without surrounding parentheses
+
Corner-cases that used to fail to raise the correct error:
>>> def f(*, x=lambda __debug__:0): pass