Revert trailing comma for 3.6<

This commit is contained in:
Batuhan Taskaya committed 2020-05-23 21:17:08 +03:00
1 parent 92396a9a16
commit 6b0e01c220
2 files changed
+14 -24

No files matched your search

+3 -12
View File
@@ -800,18 +800,9 @@ class _ArglistRule(SyntaxRule):
if argument.type == 'argument':
first = argument.children[0]
if (
argument.children[1].type in _COMP_FOR_TYPES
and len(node.children) >= 2
):
if self._normalizer.version >= (3, 7):
return True
elif len(node.children) == 2 and node.children[1] == ",":
# trailing comma allowed until 3.7
pass
else:
return True
if argument.children[1].type in _COMP_FOR_TYPES and len(node.children) >= 2:
# a(a, b for b in c)
return True
if first in ('*', '**'):
if first == '*':
if kw_unpacking_only: