Adapt Python3.9 errors on multiple star target

In Python3.9, the message "two starred expression in ..." changed
to "multiple starred expression in ...", with python/cpython#19168
This commit is contained in:
Batuhan Taskaya
2020-05-21 20:35:13 +03:00
committed by Dave Halter
parent 2dcc0d3770
commit f8709852e3

View File

@@ -684,7 +684,10 @@ class _StarExprParentRule(SyntaxRule):
args = [c for c in node.children if c != ',']
starred = [c for c in args if c.type == 'star_expr']
if len(starred) > 1:
message = "two starred expressions in assignment"
if self._normalizer.version < (3, 9):
message = "two starred expressions in assignment"
else:
message = "multiple starred expressions in assignment"
self.add_issue(starred[1], message=message)
elif starred:
count = args.index(starred[0])