[PyQt] Pylint and PyQt4 Bus Errors
Phil Thompson
phil at riverbankcomputing.com
Wed Jul 29 21:04:03 BST 2009
On Wed, 29 Jul 2009 23:05:52 +1200, Derek Harland
<derek at chocolate-fish.com>
wrote:
> Hi Sylvain (and hopefully some helpful PyQt people!)
>
> * As noted earlier, after applying my patch to get pylint to recognise
> PyQt4, pylint will Bus Error depending on import order
> eg
> from PyQt4 import QtCore, QtGui # will cause pylint to
> BusError
> from PyQt4 import QtGui , QtCore # pylint is happy ...
>
> * After a long fight of constant crashes I've debugged down to the
> statement that actually crashes :-)
> * Its because there is something strange about QtCore.QSignalMapper,
> and here is the problem replicated ...
>
> >>> from PyQt4 import QtCore
> >>> isinstance(QtCore.QSignalMapper, types.MethodType)
> Bus error
>
> However this works ...
>
> >>> from PyQt4 import QtCore, QtGui
> >>> isinstance(QtCore.QSignalMapper, types.MethodType)
> False
>
> pylint sparks a crash (or rather logilab.astng.builder does) as it
> will attempt to import and fully analyse QtCore before loading QtGui.
> I'm hoping Phil at Riverbank Software might be able to cast some light
> on what state QSignalMapper might be in before QtGui exists ...
>
> Kind regards
> Derek
>
> [Machine details:
> - OSX10.5 running macports python 2.6.2
> - PyQt4.5.4, sip 4.8.2
> - pylint 0.18, logilab.astng 0.19, logilab.common 0.42
> ]
I can reproduce this so I don't think it has anything to do with pylint.
Phil
More information about the PyQt
mailing list