parent
c6a6cfd3a2
commit
dc0c14240e
11
black.py
11
black.py
@ -885,9 +885,14 @@ def maybe_remove_trailing_comma(self, closing: Leaf) -> bool:
|
||||
self.remove_trailing_comma()
|
||||
return True
|
||||
|
||||
# For parens let's check if it's safe to remove the comma. If the
|
||||
# trailing one is the only one, we might mistakenly change a tuple
|
||||
# into a different type by removing the comma.
|
||||
# For parens let's check if it's safe to remove the comma.
|
||||
# Imports are always safe.
|
||||
if self.is_import:
|
||||
self.remove_trailing_comma()
|
||||
return True
|
||||
|
||||
# Otheriwsse, if the trailing one is the only one, we might mistakenly
|
||||
# change a tuple into a different type by removing the comma.
|
||||
depth = closing.bracket_depth + 1
|
||||
commas = 0
|
||||
opening = closing.opening_bracket
|
||||
|
@ -2,6 +2,9 @@
|
||||
|
||||
# flake8: noqa
|
||||
|
||||
from logging import (
|
||||
ERROR,
|
||||
)
|
||||
import sys
|
||||
|
||||
# This relies on each of the submodules having an __all__ variable.
|
||||
@ -48,6 +51,7 @@
|
||||
|
||||
# flake8: noqa
|
||||
|
||||
from logging import ERROR
|
||||
import sys
|
||||
|
||||
# This relies on each of the submodules having an __all__ variable.
|
||||
|
Loading…
Reference in New Issue
Block a user