python-trio / flake8-async

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

Do not raise or catch `trio.[NonBase]MultiError`; prefer `[exceptiongroup.]BaseExceptionGroup`. #105

Closed Zac-HD closed 1 year ago

Zac-HD commented 1 year ago

Trio's MultiError is deprecated in favor of the builtin (or backport of) ExceptionGroup, so downstream code should be written or ported to the latter. That includes catching, raising, and use of methods - so I think just linting for any reference to trio.MultiError would be sufficient and easy to implement.

This lint is important because MultiError is still raised from Trio, in order to give downstream time to migrate, and so users quite naturally use the name mentioned in their tracebacks.