Hi,

When sip call the __dtor__() python function on a python object, it does not print errors that occurred during the execution of the python function. If something goes wrong in this function you are not informed and so you can leave objects in an unwanted state (because of an attributeError for example).

Here is a patch to siplib.c that print the python error if it occurred during the call of the python "__dtor__()" function.
Patch is against sip-4.8-snapshot-20090401

--- ./siplib/siplib.c   2009-04-02 04:30:39.000000000 +0200
+++ ../sip-4.8-snapshot-20090401-new/siplib/siplib.c 2009-04-06 09:43:33.000000000 +0200
@@ -3841,6 +3841,11 @@
         /* Discard any result. */
         Py_XDECREF(res);

+        if (PyErr_Occurred()) {
+            PyErr_Print();
+            PyErr_Clear();
+        }
+
         SIP_RELEASE_GIL(sipGILState);
     }
 }

Regards,
--
Boutillier Alexis
Methodology engineer

Arteris SA
The Network-on-Chip Company TM
www.arteris.net

6 par Ariane Immeuble Mercure
78284 Guyancourt Cedex
France
Office: (+33) 1 61 37 38 71
Fax:    (+33) 1 61 37 38 41
[email protected]
_______________________________________________
PyQt mailing list    [email protected]
http://www.riverbankcomputing.com/mailman/listinfo/pyqt

Reply via email to