[Stackless] Stackless and PyQt compilation

Carlos Eduardo de Paula carlosedp at gmail.com
Wed Oct 29 19:34:45 CET 2008

I sent this email earlier to PyQt mailing list I'm posting it here
just to inform anyone that is interested.

Some time ago, I had some problems compiling SIP with Stackless Python.
That had been fixed manually by me until you patched siplib.c using a
pair of ifdefs.

Now, I'm recompiling my toolchain using the latest versions and found
an incompatibility between PyQt and Stackless.

The problem lies on sip/QtCore/qobject.sip. It defines a heap
structure that tries to find a reference in Python's PyHeapTypeObject
but stackless does not define this structure, it just aliases from the
PyTypeObject that does not have that slot. This breaks PyQt

I have created a patch that addresses this issue. The test had been
made on Windows XP, using Stackless Python 2.6 and QT 4.4.3 and had
been applied and compiled/worked successfully on PyQt-win-gpl-4.4.3
and PyQt-win-gpl-4.4.4-snapshot-20081022.

Here is the patch:

--- qobject.sip.orig    2008-10-28 15:18:50.511598400 -0200
+++ qobject.sip 2008-10-28 15:19:56.500249100 -0200
@@ -1308,12 +1308,16 @@

         case class_sat:
+#if defined(STACKLESS)
+                int type = QMetaType::type(as->type.u.wt->super.tp_name);
 #if PY_VERSION_HEX >= 0x02050000
                 int type =
                 int type = QMetaType::type(as->type.u.wt->super.type.tp_name);

                 // The type must be supported by the meta-object system.
                 if (type)

I hope this could be applied to PyQt so users of Stackless does not
need to patch and compile PyQt manually.



Visit Stackless Examples Project
Stackless Python - www.stackless.com

More information about the Stackless mailing list