Skip to content

Commit 82ae441

Browse files
[pre-commit.ci] auto fixes from pre-commit.com hooks
1 parent 80f9b32 commit 82ae441

2 files changed

Lines changed: 5 additions & 2 deletions

File tree

tests/test_visitors/test_ast/test_loops/test_loops/test_infinite_while_loops.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -172,7 +172,7 @@ def test_correct_while_loops_with_statements(
172172
correct_while4,
173173
correct_while5,
174174
correct_while6,
175-
correct_while7
175+
correct_while7,
176176
],
177177
)
178178
def test_correct_while_loops_with_try(

wemake_python_styleguide/visitors/ast/loops.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -178,14 +178,17 @@ def _check_infinite_while_loop(self, node: AnyLoop) -> None:
178178
if isinstance(evaled, ast.Name) or not bool(evaled):
179179
return
180180

181-
in_async_function = walk.get_closest_parent(node, ast.AsyncFunctionDef) is not None
181+
in_async_function = (
182+
walk.get_closest_parent(node, ast.AsyncFunctionDef) is not None
183+
)
182184
has_await = bool(walk.get_subnodes_by_type(node.body, ast.Await))
183185

184186
if in_async_function and has_await:
185187
return
186188

187189
self.add_violation(InfiniteWhileLoopViolation(node))
188190

191+
189192
@final
190193
@decorators.alias(
191194
'visit_any_for',

0 commit comments

Comments
 (0)