| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
Sorry, something went wrong.
| if (suppress != 1) { | ||
| if (_PyModuleSpec_IsInitializing(spec)) { | ||
| PyErr_Format(PyExc_AttributeError, | ||
| origin = PyObject_GetAttr(spec, &_Py_ID(origin)); |
There was a problem hiding this comment.
PyObject_GetAttr() can set not only AttributeError. If it sets a different error, it should not be overridden by AttributeError.
I suggest to use PyObject_GetOptionalAttr().
Sorry, something went wrong.
There was a problem hiding this comment.
Why not chain the original error to a new exception (raise from)?
Sorry, something went wrong.
There was a problem hiding this comment.
Or maybe this is a use case for adding a note to the original exception and letting it propagate on (if we don't want to change the type of the exception being raised).
Sorry, something went wrong.
|
Thank you for the reviews! |
Sorry, something went wrong.
|
I fixed some errors, please resolve conflicts. |
Sorry, something went wrong.
There was a problem hiding this comment.
LGTM.
Sorry, something went wrong.
|
Would be great to mention this nice quality-of-life improvement with an example in What's New, similar to: https://docs.python.org/3/whatsnew/3.12.html#improved-error-messages |
Sorry, something went wrong.
…python#112577) Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
…python#112577) Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
…python#112577) Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
…python#112577) Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
| Back | FazBrowse Home | New Git URL |
Following in the footsteps of: