[PyKDE] weird runtime problem with _signature

Andreas Pakulat apaku at gmx.de
Sat Jan 28 10:20:29 GMT 2006


since upgrading to the latest PyQt4 snapshot I have an extremly weird
problem here with my "plugins".

Comparing 2 classes which have absolutely nothing to do with Qt fails

/home/andreas/projects/pyfilmdbsimpleui/lib/pluginmanager.py:46: RuntimeWarning: tp_compare didn't return -1 or -2 for exception
  if plugin == clz:
Traceback (most recent call last):
  File "/home/andreas/projects/pyfilmdbsimpleui/widgets/mainwidget.py", line 65, in addMovie
    dlg = SearchMovieDialog(self)
  File "/home/andreas/projects/pyfilmdbsimpleui/widgets/searchmoviedialog.py", line 14, in __init__
    plugins = pluginmanager.get_plugins(siteparserplugin.SiteParserPlugin)
  File "/home/andreas/projects/pyfilmdbsimpleui/lib/pluginmanager.py", line 46, in get_plugins
    if plugin == clz:
AttributeError: 'builtin_function_or_method' object has no attribute '_signature'

The code at that point is:

def get_plugins(clz):
    """ Get plugin-class implementing clz"""
    plugins = []
    for plugin in PluginType.registered_plugins.values():
        if plugin == clz:
        if issubclass(plugin, clz):
    return plugins

Where PluginType is a MetaClass collecting the plugins when the
containing module is imported:

class PluginType(type): 
    """ Metaclass for BasePlugin """ 
    registered_plugins = {} 
    def __init__(cls, name, bases, dict): 
        super(PluginType, cls).__init__(name, bases, dict) 
        cls.registered_plugins[name] = cls

Now here comes the weird part: If I insert a print before the comparison
it works. If I debug through the function it works. Only when it runs
straight through I get the error...

This was working yesterday and from that error I guess it has something
to do with the decorators in PyQt4 (thats all I updated today) for


You will have good luck and overcome many hardships.

More information about the PyQt mailing list