| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
|
I'm not sure we can simply remove this from the C API, as it is unfortunately exposed via Python.h: $ echo '#include "Python.h"' | gcc -E $(./python.exe ./python-config.py --includes) - | grep _PyErr_ChainExceptions
__attribute__ ((visibility ("default"))) void _PyErr_ChainExceptions(PyObject *, PyObject *, PyObject *);
__attribute__ ((visibility ("default"))) void _PyErr_ChainExceptions1(PyObject *);cc. @encukou |
Sorry, something went wrong.
There was a problem hiding this comment.
The code looks fine, but it will need documenting.
Sorry, something went wrong.
|
|
||
| /* Context manipulation (PEP 3134) */ | ||
|
|
||
| PyAPI_FUNC(void) _PyErr_ChainExceptions(PyObject *, PyObject *, PyObject *); |
There was a problem hiding this comment.
This is marked as an API function, so it will need to be added to the "porting to 3.12" section and any other relevant sections in the "what's new".
Sorry, something went wrong.
|
When you're done making the requested changes, leave the comment: I have made the requested changes; please review again. |
Sorry, something went wrong.
It is prefixed with an underscore so we can, in theory, remove it. But we will need to document how to upgrade to 3.12. |
Sorry, something went wrong.
Currently it normalises the exception so just calling _PyErr_ChainExceptions1 with the second arg would be a change in semantics. |
Sorry, something went wrong.
This reverts commit de98c08.
|
Since it is exposed via Python.h, someone is bound to be using it, so we cannot just remove it. I'd say we mark it as deprecated using the Py_DEPRECATED macro. There's practically no maintenance overhead in keeping it around. BTW, we should consider unexposing the new API (_PyErr_ChainExceptions1) by moving it to Include/internal before 3.12 is frozen. |
Sorry, something went wrong.
|
I searched on GitHub and found quite a few usages. So I agree with just deprecating it for now. Not sure it's reasonable to not expose the alternative though, given people are using it. |
Sorry, something went wrong.
Since people are using it, we should consider dropping the underscore, IMO. |
Sorry, something went wrong.
There was a problem hiding this comment.
LGTM.
We should consider making the new API official and documenting it, in a follow-up PR.
Sorry, something went wrong.
| (Contributed by Mark Shannon in :gh:`101578`.) | ||
|
|
||
| * Add ``_PyErr_ChainExceptions1``, which takes an exception instance, | ||
| to replace the legacy-api ``_PyErr_ChainExceptions``, which is now |
There was a problem hiding this comment.
Nit: api => API
Sorry, something went wrong.
| Back | FazBrowse Home | New Git URL |
Uh oh!
There was an error while loading. Please reload this page.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.