[PATCH 3/3] make compilation work after backporting
authorlooooo <sppedflyer@gmail.com>
Sun, 12 Jan 2020 14:01:24 +0000 (15:01 +0100)
committerKurt Kremitzki <kurt@kwk.systems>
Mon, 18 May 2020 01:27:01 +0000 (02:27 +0100)
Gbp-Pq: Name 0004-make-compilation-work-after-backporting.patch

sources/shiboken2/libshiboken/basewrapper.cpp

index 1e3b7406d56e74d7848792152717060ca6d7c7c6..5824dd665d80129aa324d79db09232b8bab0bd7a 100644 (file)
@@ -506,7 +506,8 @@ PyObject *SbkObjectTypeTpNew(PyTypeObject *metatype, PyObject *args, PyObject *k
     // PYSIDE-939: This is a temporary patch that circumvents the problem
     // with Py_TPFLAGS_METHOD_DESCRIPTOR until this is finally solved.
     PyObject *ob_PyType_Type = reinterpret_cast<PyObject *>(&PyType_Type);
-    static PyObject *mro = PyObject_GetAttr(ob_PyType_Type, Shiboken::PyName::mro());
+    static PyObject *const mro_string = Shiboken::String::fromCString("mro");
+    static PyObject *mro = PyObject_GetAttr(ob_PyType_Type, mro_string);
     auto hold = Py_TYPE(mro)->tp_flags;
     Py_TYPE(mro)->tp_flags &= ~Py_TPFLAGS_METHOD_DESCRIPTOR;
     auto *newType = reinterpret_cast<SbkObjectType *>(type_new(metatype, args, kwds));