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
flake8-trio currently always just looks for trio.Cancelled, but #120 (comment)
Unfortunately anyio has a slightly different API here; see anyio.get_cancelled_exc_class(). That's important because you can have both trio and asyncio in the same program (ugh, but sometimes the least-bad option!).
Also add another error code for assigning the result of anyio.get_cancelled_exc_class() to a variable. That can be caught if within the same file with our rudimentary type tracking, but not if done across files and imported. So the plugin should likely track assignments for cases where single-backend is used and the error code gets disabled.
We probably also want to lint for "no assigning that result because it breaks our linter, as well as multi-backend programs".
The text was updated successfully, but these errors were encountered:
Matters w/r/t TRIO102, 103 and 104.
flake8-trio currently always just looks for
trio.Cancelled
, but#120 (comment)
Also add another error code for assigning the result of
anyio.get_cancelled_exc_class()
to a variable. That can be caught if within the same file with our rudimentary type tracking, but not if done across files and imported. So the plugin should likely track assignments for cases where single-backend is used and the error code gets disabled.The text was updated successfully, but these errors were encountered: