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
This was generated by AI during a pre-4.0 audit of main at 9cd88e7.
Observation
FinalizerError (exceptions/lifecycle.py:6) wraps every finalizer failure in .finalizer_errors, so AsyncFinalizerInSyncCloseError (always wrapped, registries/cache_registry.py:110-120) and user finalizer errors cannot be caught by type. The package requires Python 3.11+, where ExceptionGroup and except* exist. Changing the base class after 4.0 is breaking.
Proposal
Make FinalizerError subclass ExceptionGroup (keep ModernDIError as a base if the MRO allows; otherwise decide). .exceptions replaces .finalizer_errors; is_async stays. Decide whether to keep finalizer_errors as an alias for 4.x or remove it with a migration entry.
Acceptance
except* AsyncFinalizerInSyncCloseError and except* ValueError (user finalizer error) work, with tests for sync and async close.
except FinalizerError and except ModernDIError still catch it.
Docs (lifecycle.md, errors-and-exceptions.md) and migration guide updated.
Activity