python-trio / flake8-async

Highly opinionated linter for Trio code
https://flake8-async.readthedocs.io
MIT License
17 stars 2 forks source link

False alarm for `TRIO103`, on `except BaseException` after an `except Cancelled` clause #106

Closed Zac-HD closed 1 year ago

Zac-HD commented 1 year ago
try:
    ...
except trio.Cancelled:
    raise
except BaseException:
    pass  # this should be OK, because the error _can't_ be a Cancelled.

We should also make the README and the message for BaseException suggest this pattern.

jakkdl commented 1 year ago

Oh goodness, so spammy if you're amending a commit that mentions the issue