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