groove-x / trio-util

Utility library for the Python Trio async/await framework
https://trio-util.readthedocs.io/
MIT License
68 stars 6 forks source link

Change defer_to_* to be based on [Base]ExceptionGroup #23

Closed TeamSpen210 closed 8 months ago

TeamSpen210 commented 10 months ago

Trio will be removing MultiError in favour of using ExceptionGroup (via backport on <3.11). This renames multi_error_defer_toexcept_group_defer_to and changes the logic to detect BaseExceptionGroup instead of MultiError. Since MultiError is a subclass, this should still work with existing code. The old name has an alias that warns when used.

While I was editing the module, I also fully type hinted it.

codecov-commenter commented 10 months ago

Codecov Report

Attention: 3 lines in your changes are missing coverage. Please review.

Comparison is base (c908bc7) 100.00% compared to head (34d5ec8) 99.35%.

Files Patch % Lines
src/trio_util/_exceptions.py 91.66% 3 Missing :warning:

:exclamation: Your organization needs to install the Codecov GitHub app to enable full functionality.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## master #23 +/- ## =========================================== - Coverage 100.00% 99.35% -0.65% =========================================== Files 15 15 Lines 454 468 +14 =========================================== + Hits 454 465 +11 - Misses 0 3 +3 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

TeamSpen210 commented 10 months ago

I didn't consider this only really being for pre-ExceptionGroup code. Might just close this then, if they should be effectively deprecated?