Can lead to pylint crash. See the debian bug report for details. To reproduce, run pylint on:
from PyQt4 import QtCore
class Cl(object):
def method(self, r = QtCore.Qt.DisplayRole):
pass
Maarten ter Huurne: 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. | |
| priority | important |
|---|---|
| type | bug |
| appeared in | <not specified> |
| done in | <not specified> |
| load | 0.500 |
| load left | 0.500 |
| debian bug number | 435869 |
| closed by | <not specified> |


#4589 No line number for Lambda
Comments
-
2008/10/24 11:55, written by anon
| reply to this comment
-
2008/11/19 15:02, written by sthenault
| reply to this comment
(add comment)As far as I understand the logic of astng, this to nobody expects NotFoundError exception to popgrade to client code. I think the following patch fixes the problem in a proper way:
--- logilab/astng/__init__.py.orig 2008-10-24 13:47:47 +0400 +++ logilab/astng/__init__.py 2008-10-24 13:35:59 +0400 @@ -124,6 +124,8 @@ def _infer_stmts(stmts, context, frame=N infered = True except UnresolvableName: continue + except NotFoundError: + continue except InferenceError: yield YES infered = TrueI've fixed the crash, though the pb of resolving nested classes is still there...