From e10e7c771bf06112c4a311e0ef6b8af6423b0cca Mon Sep 17 00:00:00 2001 From: Lysandros Nikolaou Date: Mon, 4 May 2020 13:58:31 +0300 Subject: bpo-40334: Spacialized error message for invalid args after bare '*' (GH-19865) When parsing things like `def f(*): pass` the old parser used to output `SyntaxError: named arguments must follow bare *`, which the new parser wasn't able to do. --- Lib/test/test_exceptions.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'Lib/test/test_exceptions.py') diff --git a/Lib/test/test_exceptions.py b/Lib/test/test_exceptions.py index 354b3f4843..d83b73ab34 100644 --- a/Lib/test/test_exceptions.py +++ b/Lib/test/test_exceptions.py @@ -242,11 +242,11 @@ class ExceptionTests(unittest.TestCase): check('from __future__ import doesnt_exist', 1, 1) check('from __future__ import braces', 1, 1) check('x=1\nfrom __future__ import division', 2, 1) + check('def f(*):\n pass', 1, 7 if support.use_old_parser() else 8) @support.skip_if_new_parser("Pegen column offsets might be different") def testSyntaxErrorOffsetCustom(self): self.check('for 1 in []: pass', 1, 5) - self.check('def f(*):\n pass', 1, 7) self.check('[*x for x in xs]', 1, 2) self.check('def f():\n x, y: int', 2, 3) self.check('(yield i) = 2', 1, 1) -- cgit v1.2.1