File tree Expand file tree Collapse file tree
wemake_python_styleguide/visitors/ast Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -16,6 +16,12 @@ Semantic versioning in our case means:
1616 But, in the future we might change the configuration names/logic,
1717 change the client facing API, change code conventions significantly, etc.
1818
19+ ## WIP
20+
21+ ### Bugfixes
22+
23+ - Fixes false positive ` WPS457 ` for while `` True loop `` with ` await ` in expression, #3753
24+
1925
2026## 1.5.0
2127
@@ -30,7 +36,6 @@ Semantic versioning in our case means:
3036
3137- Fixes ` WPS226 ` false-positive on fstring parts, #3548
3238- Fixes false positive ` WPS412 ` with docstring and imports in ` __init__.py ` , #3569
33- - Fixes false positive ` WPS457 ` for while True loop with await in async function #3753
3439
3540### Misc
3641
Original file line number Diff line number Diff line change @@ -178,12 +178,8 @@ 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 = (
182- walk .get_closest_parent (node , ast .AsyncFunctionDef ) is not None
183- )
184- has_await = bool (walk .get_subnodes_by_type (node , ast .Await ))
185-
186- if in_async_function and has_await :
181+ has_await = any (walk .get_subnodes_by_type (node , ast .Await ))
182+ if has_await :
187183 return
188184
189185 self .add_violation (InfiniteWhileLoopViolation (node ))
You can’t perform that action at this time.
0 commit comments