From 62b30e7fae5402ead78fdd9315fb3d6e20bce36f Mon Sep 17 00:00:00 2001 From: Steve Kowalik Date: Wed, 29 Jul 2026 20:23:35 +1000 Subject: [PATCH] Support Python 3.15 exception message changes (#240) Python 3.15 changed the wording of some SyntaxError exceptions to make it clearer. Closes #239 --- parso/python/errors.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/parso/python/errors.py b/parso/python/errors.py index 09c5047..0916fb3 100644 --- a/parso/python/errors.py +++ b/parso/python/errors.py @@ -973,7 +973,10 @@ class _ParameterRule(SyntaxRule): continue if p.name.value in param_names: - message = "duplicate argument '%s' in function definition" + if sys.version_info[:2] < (3, 15): + message = "duplicate argument '%s' in function definition" + else: + message = "duplicate parameter '%s' in function definition" self.add_issue(p.name, message=message % p.name.value) param_names.add(p.name.value)