[PyQt] Fwd: Mixin classes and PyQt4

Martin Teichmann martin.teichmann at gmail.com
Wed Feb 12 09:35:56 GMT 2014


Hi Phil, Hi Baz, Hi List,

I just wrote a patch as advertised earlier, which checks that the
inheritance is correct and that noone attempts to inherit from more
than one PyQt base class. It is based on the patch sent earlier.
Maybe this is an improvement enough to put my patches in?

Greetings

Martin

Patch follows:

--- siplib.c.in    2014-02-12 10:26:18.885579447 +0100
+++ siplib.in.new    2014-02-12 10:30:59.263560644 +0100
@@ -9367,6 +9367,7 @@
     {
         PyObject *mro = ((PyTypeObject *)self)->tp_mro;
         PyObject *base;
+        PyTypeObject *solid;
         int i, n = PyTuple_GET_SIZE(mro);

         /*
@@ -9385,6 +9386,15 @@
                     break;
             }
         }
+        solid = (PyTypeObject *) base;
+        for (; i < n; i++) {
+            base = PyTuple_GET_ITEM(mro, i);
+            if (!PyType_IsSubtype(solid, (PyTypeObject *) base)) {
+                PyErr_Format(PyExc_TypeError,
+                             "multiple C++ base classes are illegal");
+                return -1;
+            }
+        }
     }
     else
     {
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.riverbankcomputing.com/pipermail/pyqt/attachments/20140212/c9c67b2c/attachment-0001.html>


More information about the PyQt mailing list