diff options
author | Eric Snow <ericsnowcurrently@gmail.com> | 2025-06-13 16:45:21 -0600 |
---|---|---|
committer | GitHub <noreply@github.com> | 2025-06-13 16:45:21 -0600 |
commit | c7f4a80079eefc02839f193ba07ce1b33d067d8d (patch) | |
tree | 98343eb0d9ac5b00c512edf0923524ed8fe459b2 /Python/crossinterp_exceptions.h | |
parent | 6eb6c5dbfb528bd07d77b60fd71fd05d81d45c41 (diff) | |
download | cpython-c7f4a80079eefc02839f193ba07ce1b33d067d8d.tar.gz cpython-c7f4a80079eefc02839f193ba07ce1b33d067d8d.zip |
gh-132775: Clean Up Cross-Interpreter Error Handling (gh-135369)
In this refactor we:
* move some code around
* make a couple of typedefs opaque
* decouple errors from session state
* improve tracebacks for propagated exceptions
This change helps simplify several upcoming changes.
Diffstat (limited to 'Python/crossinterp_exceptions.h')
-rw-r--r-- | Python/crossinterp_exceptions.h | 7 |
1 files changed, 0 insertions, 7 deletions
diff --git a/Python/crossinterp_exceptions.h b/Python/crossinterp_exceptions.h index 12cd61db1b6..98411adc5eb 100644 --- a/Python/crossinterp_exceptions.h +++ b/Python/crossinterp_exceptions.h @@ -7,13 +7,6 @@ _ensure_current_cause(PyThreadState *tstate, PyObject *cause) } PyObject *exc = _PyErr_GetRaisedException(tstate); assert(exc != NULL); - PyObject *ctx = PyException_GetContext(exc); - if (ctx == NULL) { - PyException_SetContext(exc, Py_NewRef(cause)); - } - else { - Py_DECREF(ctx); - } assert(PyException_GetCause(exc) == NULL); PyException_SetCause(exc, Py_NewRef(cause)); _PyErr_SetRaisedException(tstate, exc); |