diff --git a/src/black/lines.py b/src/black/lines.py index b2bdcc441b4..fb5933ecbfb 100644 --- a/src/black/lines.py +++ b/src/black/lines.py @@ -598,7 +598,7 @@ def _maybe_empty_lines(self, current_line: Line) -> Tuple[int, int]: before = 1 elif ( not depth - and self.previous_defs[-1] + and self.previous_defs[-1].depth and current_line.leaves[-1].type == token.COLON and ( current_line.leaves[0].value