diff --git a/src/black/lines.py b/src/black/lines.py index f1de1f59235..01208c5fa7d 100644 --- a/src/black/lines.py +++ b/src/black/lines.py @@ -716,7 +716,7 @@ def _maybe_empty_lines_for_class_or_def( # noqa: C901 # statement in the same level, we always want a blank line if there's # something with a body preceding. elif ( - Preview.blank_line_between_nested_and_def_stub_file + Preview.blank_line_between_nested_and_def_stub_file in current_line.mode and self.previous_line.depth > current_line.depth ): newlines = 1