Skip to content

Commit f207865

Browse files
committed
add PyException_GetCause
1 parent 2c94022 commit f207865

File tree

6 files changed

+1080
-1062
lines changed

6 files changed

+1080
-1062
lines changed

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

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1641,6 +1641,10 @@ PyAPI_FUNC(void) PyEval_RestoreThread(PyThreadState* a) {
16411641
PyAPI_FUNC(PyThreadState*) PyEval_SaveThread() {
16421642
return GraalPyEval_SaveThread();
16431643
}
1644+
#undef PyException_GetCause
1645+
PyAPI_FUNC(PyObject*) PyException_GetCause(PyObject* a) {
1646+
return GraalPyException_GetCause(a);
1647+
}
16441648
#undef PyException_GetContext
16451649
PyAPI_FUNC(PyObject*) PyException_GetContext(PyObject* a) {
16461650
return GraalPyException_GetContext(a);

graalpython/com.oracle.graal.python.cext/src/capi.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -148,6 +148,7 @@ typedef struct {
148148
BUILTIN(PyEval_GetBuiltins, PyObject*) \
149149
BUILTIN(PyEval_RestoreThread, void, PyThreadState*) \
150150
BUILTIN(PyEval_SaveThread, PyThreadState*) \
151+
BUILTIN(PyException_GetCause, PyObject*, PyObject*) \
151152
BUILTIN(PyException_GetContext, PyObject*, PyObject*) \
152153
BUILTIN(PyException_SetCause, void, PyObject*, PyObject*) \
153154
BUILTIN(PyException_SetContext, void, PyObject*, PyObject*) \

graalpython/com.oracle.graal.python.jni/src/capi_forwards.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2386,7 +2386,8 @@ PyAPI_FUNC(const char*) PyExceptionClass_Name(PyObject* a) {
23862386
unimplemented("PyExceptionClass_Name"); exit(-1);
23872387
}
23882388
PyAPI_FUNC(PyObject*) PyException_GetCause(PyObject* a) {
2389-
unimplemented("PyException_GetCause"); exit(-1);
2389+
PyObject* result = (PyObject*) GraalPyException_GetCause(a);
2390+
return result;
23902391
}
23912392
PyAPI_FUNC(PyObject*) PyException_GetContext(PyObject* a) {
23922393
PyObject* result = (PyObject*) GraalPyException_GetContext(a);

0 commit comments

Comments
 (0)