[Python-projects] Pylint failed on checking Python module...

Stojan Jović stojan.jovic at dmsgroup.rs
Thu Dec 11 14:21:32 CET 2008


Here is the error message:

Traceback (most recent call last):
  File "C:\Python25\Scripts\pylint.bat", line 12, in <module>
    lint.Run(sys.argv[1:])
  File "C:\Python25\lib\site-packages\pylint\lint.py", line 901, in __init__
    linter.check(args)
  File "C:\Python25\lib\site-packages\pylint\lint.py", line 492, in check
    self.check_astng_module(astng, checkers)
  File "C:\Python25\lib\site-packages\pylint\lint.py", line 602, in 
check_astng_module
    if implements(checker, IASTNGChecker)])
  File "C:\Python25\lib\site-packages\pylint\lint.py", line 619, in 
astng_events
    self.astng_events(child, checkers, _reversed_checkers)
  File "C:\Python25\lib\site-packages\pylint\lint.py", line 619, in 
astng_events
    self.astng_events(child, checkers, _reversed_checkers)
  File "C:\Python25\lib\site-packages\pylint\lint.py", line 619, in 
astng_events
    self.astng_events(child, checkers, _reversed_checkers)
  File "C:\Python25\lib\site-packages\pylint\lint.py", line 619, in 
astng_events
    self.astng_events(child, checkers, _reversed_checkers)
  File "C:\Python25\lib\site-packages\pylint\lint.py", line 616, in 
astng_events
    checker.visit(astng)
  File "C:\Python25\lib\site-packages\logilab\astng\utils.py", line 84, 
in visit
    method(node)
  File "C:\Python25\lib\site-packages\pylint\checkers\base.py", line 
371, in visit_function
    self._check_defaults(node)
  File "C:\Python25\lib\site-packages\pylint\checkers\base.py", line 
536, in _check_defaults
    value = default.infer().next()
  File "C:\Python25\lib\site-packages\logilab\astng\inference.py", line 
51, in wrapped
    if not ares in yielded:
  File "C:\Python25\lib\site-packages\logilab\astng\__init__.py", line 
276, in Const___getattr__
    self._proxied = MANAGER.astng_from_class(self.value.__class__)
  File "C:\Python25\lib\site-packages\logilab\astng\manager.py", line 
191, in astng_from_class
    return modastng.getattr(klass.__name__)[0] # XXX
  File "C:\Python25\lib\site-packages\logilab\astng\scoped_nodes.py", 
line 229, in getattr
    raise NotFoundError(name)
logilab.astng._exceptions.NotFoundError: WindowType

Pylint raised this on something like this in Python code:

...
from PyQt4 import QtGui, QtCore
from PyQt4.QtCore import Qt

class GenericWidget(QtGui.QWidget):
    def __init__(self, parent=None, title = '', attributes=Qt.Widget):
...
or
...
from PyQt4 import QtGui, QtCore
from PyQt4.QtCore import Qt

class GenericWindow(QtGui.QMainWindow):
    def __init__(self, parent=None, title='', attributes=Qt.Window):
...

Reason of this error is "attributes=Qt.Widget" and 
"attributes=Qt.Window" expressions in given source code, which is 
absolutely regular!?
Where is the problem?

Regards,
Stojan

-- 
=============================================================================
Computer Science and Informatics
Computing and Control Department
Faculty of Technical Sciences
21000 Novi Sad
Serbia

http://www.ftn.ns.ac.yu
http://www.ftn.ns.ac.yu/english
=============================================================================



More information about the Python-Projects mailing list