TRIO100 false positive with an async CM (already fixed in flake8-trio
- ruff is out of date)
#9934
Labels
bug
Something isn't working
Ruff 0.2.1
The following snippet illustrates a TRIO100 false positive when the scope contains an async context manager. Note that this bug is already fixed in
flake8-trio
(in python-trio/flake8-async/pull/176 I think). It's probably worth checking whether ruff needs to port other more recent fixes, as well.The above is a valid case for a cancel scope with no explicit awaits in the body. Without the cancel(), this hangs forever instead of exiting.
Note: if I put an
async for
in thetry:
, it's even more obvious that this yields, but TRIO100 still triggers.The text was updated successfully, but these errors were encountered: