X-Git-Url: https://git.madduck.net/etc/vim.git/blobdiff_plain/c6a6cfd3a293a69c29f93beca1c64bd857371e14..dc0c14240e7423d9ada002835dcc195f8c6d8797:/black.py?ds=inline diff --git a/black.py b/black.py index 4675456..fd2b75e 100644 --- a/black.py +++ b/black.py @@ -885,9 +885,14 @@ class Line: 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