You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Add lint error for _any_ except block that might raise #262
c.f. python-trio/trio#455 (comment) - this would be similar to ASYNC102 but I think ideally a separate rule so that people who wish to disable this (if lost exceptions aren't a big deal for them) don't reintroduce lost cancellations.
We should probably also do something similar for __aexit__ methods, although this gets increasingly awkward for @asynccontextmanager functions and so that should probably be a further separate rule.
__aexit__ seems straightforward, we just treat the content of the whole method as if it's a finally:, and can probably use ASYNC102 for it.
For @asynccontextmanager, 102/120 should already cover if the yield is inside a try: - so I think that should maybe have an entirely separate rule for yield-in-async-cm-not-in-try?
changed the title [-]New rule: warn about _any_ `except` block that might raise[/-][+]Add lint error for _any_ `except` block that might raise[/+]on Aug 3, 2024
Activity
jakkdl commentedon Jul 17, 2024
__aexit__seems straightforward, we just treat the content of the whole method as if it's afinally:, and can probably useASYNC102for it.For
@asynccontextmanager, 102/120 should already cover if the yield is inside atry:- so I think that should maybe have an entirely separate rule foryield-in-async-cm-not-in-try?[-]New rule: warn about _any_ `except` block that might raise[/-][+]Add lint error for _any_ `except` block that might raise[/+]jakkdl commentedon Oct 28, 2024
with #307 closed this is now fully addressed once #306 is merged