Skip to content

Commit 10c96b1

Browse files
committed
[ignore] curious for diff shade output
1 parent 8d80aec commit 10c96b1

File tree

1 file changed

+3
-7
lines changed

1 file changed

+3
-7
lines changed

src/black/linegen.py

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -281,7 +281,7 @@ def visit_match_case(self, node: Node) -> Iterator[Line]:
281281

282282
def visit_suite(self, node: Node) -> Iterator[Line]:
283283
"""Visit a suite."""
284-
if self.mode.is_pyi and is_stub_suite(node):
284+
if is_stub_suite(node):
285285
yield from self.visit(node.children[2])
286286
else:
287287
yield from self.visit_default(node)
@@ -296,19 +296,15 @@ def visit_simple_stmt(self, node: Node) -> Iterator[Line]:
296296

297297
is_suite_like = node.parent and node.parent.type in STATEMENT
298298
if is_suite_like:
299-
if self.mode.is_pyi and is_stub_body(node):
299+
if is_stub_body(node):
300300
yield from self.visit_default(node)
301301
else:
302302
yield from self.line(+1)
303303
yield from self.visit_default(node)
304304
yield from self.line(-1)
305305

306306
else:
307-
if (
308-
not self.mode.is_pyi
309-
or not node.parent
310-
or not is_stub_suite(node.parent)
311-
):
307+
if not node.parent or not is_stub_suite(node.parent):
312308
yield from self.line()
313309
yield from self.visit_default(node)
314310

0 commit comments

Comments
 (0)