Skip to content

Commit 9c3d0af

Browse files
committed
add PyErr_SetExcInfo
1 parent 2c832ef commit 9c3d0af

File tree

1 file changed

+7
-3
lines changed
  • graalpython/com.oracle.graal.python.cext/src

1 file changed

+7
-3
lines changed

graalpython/com.oracle.graal.python.cext/src/errors.c

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ void PyErr_BadInternalCall(void) {
5151

5252

5353
PyObject* PyErr_Occurred() {
54-
return UPCALL_CEXT_O("PyErr_Occurred", ERROR_MARKER);
54+
return UPCALL_CEXT_O("PyErr_Occurred", ERROR_MARKER);
5555
}
5656

5757
void PyErr_SetString(PyObject *exception, const char *string) {
@@ -107,11 +107,11 @@ static void _PyErr_GetOrFetchExcInfo(int consume, PyObject **p_type, PyObject **
107107
}
108108

109109
void PyErr_Fetch(PyObject **p_type, PyObject **p_value, PyObject **p_traceback) {
110-
_PyErr_GetOrFetchExcInfo(1, p_type, p_value, p_traceback);
110+
_PyErr_GetOrFetchExcInfo(1, p_type, p_value, p_traceback);
111111
}
112112

113113
void PyErr_GetExcInfo(PyObject **p_type, PyObject **p_value, PyObject **p_traceback) {
114-
_PyErr_GetOrFetchExcInfo(0, p_type, p_value, p_traceback);
114+
_PyErr_GetOrFetchExcInfo(0, p_type, p_value, p_traceback);
115115
Py_XINCREF(*p_type);
116116
Py_XINCREF(*p_value);
117117
Py_XINCREF(*p_traceback);
@@ -161,3 +161,7 @@ void PyErr_NormalizeException(PyObject **exc, PyObject **val, PyObject **tb) {
161161
// TODO (tfel): do we have to?
162162
return;
163163
}
164+
165+
void PyErr_SetExcInfo(PyObject *p_type, PyObject *p_value, PyObject *p_traceback) {
166+
PyErr_Restore(p_type, p_value, p_traceback);
167+
}

0 commit comments

Comments
 (0)