Errors¶
Error classes and error-handling helpers used by the packaging library.
Currently this contains ExceptionGroup, a simple
backport of the stdlib ExceptionGroup. It is recommended to use
the stdlib module on Python 3.11+, but this does reexport that as well.
Recommended Usage¶
if sys.version_info < (3, 11):
from packaging.errors import ExceptionGroup
try:
...
except ExceptionGroup as err:
for error in err.exceptions:
...
Reference¶
- class packaging.errors.ExceptionGroup(message: str, exceptions: list[Exception])¶
On older Pythons, this is a small fallback implementation of the
ExceptionGroupintroduced in Python 3.11.- Parameters:
message – The message for the group.
exceptions – A list of exceptions contained in the group.
Attributes¶
- message (str)
The message passed to the group.
- exceptions (list[Exception])
The exceptions contained in the group.