Skip to content

Commit

Permalink
Merge pull request #159 from pauldmccarthy/mnt/pyerr-restore
Browse files Browse the repository at this point in the history
MNT: Call `PyErr_Restore` to clear error state
  • Loading branch information
pauldmccarthy authored Nov 18, 2024
2 parents 2118dad + 2282616 commit b20e204
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,12 @@
# `indexed_gzip` changelog


## 1.9.2 (November 18th 2024)


* Adjustment to exception handling (#158).


## 1.9.1 (November 15th 2024)


Expand Down
3 changes: 2 additions & 1 deletion indexed_gzip/indexed_gzip.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ from cpython.buffer cimport (PyObject_GetBuffer,
from cpython.ref cimport (PyObject,
Py_XDECREF)
from cpython.exc cimport (PyErr_Fetch,
PyErr_Fetch,
PyErr_Restore,
PyErr_NormalizeException,
PyErr_Occurred)
from indexed_gzip.set_traceback cimport PyException_SetTraceback
Expand Down Expand Up @@ -102,6 +102,7 @@ cdef get_python_exception():
exc = <object>pvalue
if PY3 and (ptraceback != NULL):
PyException_SetTraceback(pvalue, NULL)
PyErr_Restore(NULL, NULL, NULL)
Py_XDECREF(ptype)
Py_XDECREF(pvalue)
Py_XDECREF(ptraceback)
Expand Down

0 comments on commit b20e204

Please sign in to comment.