Skip to content

Commit 25357cf

Browse files
timfelfangerer
authored andcommitted
avoid roundtrip
1 parent 19dfbcd commit 25357cf

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,5 +44,5 @@ PyTypeObject PyBaseObject_Type = PY_TRUFFLE_TYPE("object", &PyType_Type, Py_TPFL
4444
PyTypeObject PySuper_Type = PY_TRUFFLE_TYPE("super", &PyType_Type, Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC | Py_TPFLAGS_BASETYPE);
4545

4646
int PyType_IsSubtype(PyTypeObject* a, PyTypeObject* b) {
47-
return as_int(truffle_invoke(PY_TRUFFLE_CEXT, "PyType_IsSubtype", to_java((PyObject*)a), to_java((PyObject*)b)));
47+
return polyglot_as_i32(polyglot_invoke(PY_TRUFFLE_CEXT, "PyType_IsSubtype", to_java((PyObject*)a), to_java((PyObject*)b)));
4848
}

graalpython/lib-graalpython/python_cext.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -680,7 +680,7 @@ def PyObject_Repr(o):
680680

681681

682682
def PyType_IsSubtype(a, b):
683-
return b in a.mro()
683+
return 1 if b in a.mro() else 0
684684

685685

686686
@may_raise

0 commit comments

Comments
 (0)