Hi Sylvain and Manuel,

I edited logilab/astng/manager.py in the following way: (line 190)

        modastng = self.astng_from_module_name(modname)
        try:
            return modastng.getattr(klass.__name__)[0] # XXX
        except NotFoundError:
            return None

This requires an additional import of NotFoundError: (line 36)

from logilab.astng import ASTNGBuildingException, Instance, NotFoundError, 
nodes

This avoids the crash, but it will probably lead to less checks being 
performed.


I think I have identified the cause of this bug:

This problem seems to occur on all enum types from PyQt4: "ItemDataRole" is 
one, but it also occurs on "ConnectionType". The enums are wrapped inside a 
class named "Qt". So the full name of "ItemDataRole" 
is "PyQt4.QtCore.Qt.ItemDataRole".

The function "astng_from_class" is called with "ItemDataRole" as the class 
and "PyQt4.QtCore" as the module, both of which are correct. But because of 
the "Qt" wrapper class, "ItemDataRole" does not exist directly 
under "PyQt4.QtCore", where it is expected by this function.

Bye,
                Maarten

Attachment: signature.asc
Description: This is a digitally signed message part.

Reply via email to