GeezerVisonThe World Wide Web, restored to 800 pixels of glory. | |||||||||||||||||||||||||||||||
| Home|About|Gaming cabinet|Archives|How it works|Starter sites | |||||||||||||||||||||||||||||||
GeezerVison is showing github.com — gh-102192: deprecate _PyErr_ChainExceptions by iritkatriel · Pull Request #102935 · python/cpython Conversation
|
|
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 an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
The code looks fine, but it will need documenting.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
|
||
| /* Context manipulation (PEP 3134) */ | ||
|
|
||
| PyAPI_FUNC(void) _PyErr_ChainExceptions(PyObject *, PyObject *, PyObject *); |
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
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.
There was an error while loading. Please reload this page.
|
When you're done making the requested changes, leave the comment: |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
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.
There was an error while loading. Please reload this page.
Currently it normalises the exception so just calling _PyErr_ChainExceptions1 with the second arg would be a change in semantics. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
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 BTW, we should consider unexposing the new API ( |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
|
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.
There was an error while loading. Please reload this page.
Since people are using it, we should consider dropping the underscore, IMO. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
LGTM.
We should consider making the new API official and documenting it, in a follow-up PR.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
| (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.
The reason will be displayed to describe this comment to others. Learn more.
Nit: api => API
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
Successfully merging this pull request may close these issues.
There was an error while loading. Please reload this page.