Fix trailing comma error

This commit is contained in:
Robin Fourcade
2019-12-04 17:21:22 +01:00
committed by Dave Halter
parent ee2995c110
commit e496b07b63
2 changed files with 13 additions and 1 deletions

View File

@@ -586,7 +586,7 @@ class _TrailingImportComma(SyntaxRule):
message = "trailing comma not allowed without surrounding parentheses"
def is_issue(self, node):
if node.children[-1] == ',':
if node.children[-1] == ',' and node.parent.children[-1] != ')':
return True