`WPS457` false positive with `while` in `try` / `except`
bughelp wantedlevel:startergood first issue
I have the following code:
```python
def factory() -> Iterator[bytes]:
try:
while True: # noqa: WPS457
yield async_to_sync(async_anext)(iterator)
except StopAsyncIteration:
pass
```
It should not raise `WPS457`, because `while` is in `try` / `except`.
It can clearly raise and we handle the error. So, it is not infinite.
PRs are welcome! 👍
1 条评论