Skip to content

Commit 00e017c

Browse files
committed
Implement PyErr_GivenExceptionMatches in C
1 parent e2e961c commit 00e017c

File tree

3 files changed

+1
-13
lines changed

3 files changed

+1
-13
lines changed

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

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -173,7 +173,6 @@ PyErr_Occurred(void)
173173
}
174174

175175

176-
#if 0 // GraalPy change
177176
int
178177
PyErr_GivenExceptionMatches(PyObject *err, PyObject *exc)
179178
{
@@ -204,7 +203,6 @@ PyErr_GivenExceptionMatches(PyObject *err, PyObject *exc)
204203

205204
return err == exc;
206205
}
207-
#endif // GraalPy change
208206

209207

210208
int

graalpython/com.oracle.graal.python/src/com/oracle/graal/python/builtins/modules/cext/PythonCextErrBuiltins.java

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -395,17 +395,6 @@ Object info(
395395
}
396396
}
397397

398-
@CApiBuiltin(ret = Int, args = {PyObject, PyObject}, call = Direct)
399-
abstract static class PyErr_GivenExceptionMatches extends CApiBinaryBuiltinNode {
400-
401-
@Specialization
402-
static int matches(Object err, Object exc,
403-
@Bind("this") Node inliningTarget,
404-
@Cached PyErrExceptionMatchesNode matchesNode) {
405-
return PInt.intValue(matchesNode.execute(inliningTarget, err, exc));
406-
}
407-
}
408-
409398
@CApiBuiltin(ret = Void, args = {ConstCharPtrAsTruffleString, PyObject}, call = Direct)
410399
abstract static class _PyErr_WriteUnraisableMsg extends CApiBinaryBuiltinNode {
411400
@Specialization

graalpython/com.oracle.graal.python/src/com/oracle/graal/python/builtins/objects/cext/capi/CApiFunction.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -244,6 +244,7 @@ public final class CApiFunction {
244244
@CApiBuiltin(name = "PyErr_Format", ret = PyObject, args = {PyObject, ConstCharPtrAsTruffleString, VARARGS}, call = CImpl)
245245
@CApiBuiltin(name = "PyErr_FormatV", ret = PyObject, args = {PyObject, ConstCharPtrAsTruffleString, VA_LIST}, call = CImpl)
246246
@CApiBuiltin(name = "PyErr_GetExcInfo", ret = Void, args = {PyObjectPtr, PyObjectPtr, PyObjectPtr}, call = CImpl)
247+
@CApiBuiltin(name = "PyErr_GivenExceptionMatches", ret = Int, args = {PyObject, PyObject}, call = CImpl)
247248
@CApiBuiltin(name = "PyErr_NoMemory", ret = PyObject, args = {}, call = CImpl)
248249
@CApiBuiltin(name = "PyErr_NormalizeException", ret = Void, args = {PyObjectPtr, PyObjectPtr, PyObjectPtr}, call = CImpl)
249250
@CApiBuiltin(name = "PyErr_Occurred", ret = PyObjectBorrowed, args = {}, call = CImpl)

0 commit comments

Comments
 (0)