Conversation
9981cd4 to
51910f8
Compare
sirosen
left a comment
There was a problem hiding this comment.
FWIW, this version of ErrorCollector provides the things I was wanting when I tried it: on_exit() and error() (the inner append() helper).
src/packaging/errors.py
Outdated
| import sys | ||
| import typing | ||
|
|
||
| __all__ = ["ErrorCollector", "ExceptionGroup"] |
There was a problem hiding this comment.
I have a question about __all__, the class names, and the module name:
Is packaging.errors meant to be a public interface? Users presumably may want it to get packaging.errors.ExceptionGroup.
But should ErrorCollector be public? Does it make sense to name it _ErrorCollector to mark it internal to packaging?
There was a problem hiding this comment.
No docs for this module (yet?), and
ErrorCollectordoesn't have an underscore, but maybe it should, since it's designed for our use.
(above)
Yes on the packaging.errors.ExceptionGroup, users need it to handle ExceptionGroup before 3.11.
Signed-off-by: Henry Schreiner <henryfs@princeton.edu>
Signed-off-by: Henry Schreiner <henryfs@princeton.edu>
Signed-off-by: Henry Schreiner <henryfs@princeton.edu>
Signed-off-by: Henry Schreiner <henryfs@princeton.edu>
3278a88 to
0003262
Compare
This moves the
ExceptionGroupbackport intoerrors.py, and adds anErrorCollector, based on the one in pyproject-metadata, see here. Pulled out of #847 in support of #1065.No docs for this module (yet?), and
Edit: made it private.ErrorCollectordoesn't have an underscore, but maybe it should, since it's designed for our use.This ErrorCollector doesn't have a toggle to turn off error collection, since it wasn't needed here (and probably not needed for any new API that always raises ExceptionGroups), though maybe it's still handy for debugging?
ErrorCollectorchanges in this commit)