From e27fa00ef39ecfba8f1b204a775ec8b167030a25 Mon Sep 17 00:00:00 2001 From: Karl Nelson Date: Sun, 15 Sep 2024 18:16:27 -0700 Subject: [PATCH] Fix coverage test --- native/python/pyjp_class.cpp | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/native/python/pyjp_class.cpp b/native/python/pyjp_class.cpp index 1bfc54136..986aefeee 100644 --- a/native/python/pyjp_class.cpp +++ b/native/python/pyjp_class.cpp @@ -273,7 +273,7 @@ int PyJPClass_init(PyObject *self, PyObject *args, PyObject *kwargs) // Python 3.13 - This flag will try to place the dictionary are part of the object which // adds an unknown number of bytes to the end of the object making it impossible // to attach our needed data. If we kill the flag then we get usable behavior. - typenew->tp_flags &= ~Py_TPFLAGS_INLINE_VALUES; + type->tp_flags &= ~Py_TPFLAGS_INLINE_VALUES; #endif // Verify that we were called internally @@ -311,12 +311,7 @@ int PyJPClass_init(PyObject *self, PyObject *args, PyObject *kwargs) { PyObject *item = PyTuple_GetItem(bases, i); JPClass *cls = PyJPClass_getJPClass(item); - if (cls != nullptr) - { - PyErr_SetString(PyExc_TypeError, "All bases must be Java types"); - return -1; - } - if (cls->isFinal()) + if (cls != nullptr && cls->isFinal()) { PyErr_Format(PyExc_TypeError, "Cannot extend final class '%s'", ((PyTypeObject*) item)->tp_name);