Email [Python-projects] pylint failure?

from
Alessandro Caproni <acaproni at eso dot org>
subject
[Python-projects] pylint failure?
date
2005/02/09 16:23
Dear sirs,
We have recently added pylint to our nightly build and test procedures. 
The tool is very useful and we are very happy with it.

pylint checks every module/packages of our software without problems 
with the exception of the two following situations:

1. we have a method that contains the following lines:
     ...
   class tClass(eval(enumName, tGlobals, tLocals), Penum):
      pass
   ...

2. In the second case the tool fails checking the following constructor:
   def __init__(self, *args):
     _swig_setattr(self, EpochHelper, 'this', 
_acstimeSWIG.new_EpochHelper(*args))
     _swig_setattr(self, EpochHelper, 'thisown', 1)

The failure is the same in both cases:
Traceback (most recent call last):
  File "/usr/bin/pylint", line 5, in ?
    lint.Run(sys.argv[1:])
  File "/usr/lib/python2.2/site-packages/logilab/pylint/lint.py", line 
693, in __init__
    linter.check(args)
  File "/usr/lib/python2.2/site-packages/logilab/pylint/lint.py", line 
390, in check
    self.check_file(filepath, modname, checkers)
  File "/usr/lib/python2.2/site-packages/logilab/pylint/lint.py", line 
405, in check_file
    astng = self._check_file(filepath, modname, checkers)
  File "/usr/lib/python2.2/site-packages/logilab/pylint/lint.py", line 
429, in _check_file
    self.check_astng_module(astng, checkers)
  File "/usr/lib/python2.2/site-packages/logilab/pylint/lint.py", line 
476, in check_astng_module
    self.astng_events(astng, [checker for checker in checkers
  File "/usr/lib/python2.2/site-packages/logilab/pylint/lint.py", line 
493, in astng_events
    self.astng_events(child, checkers)
  File "/usr/lib/python2.2/site-packages/logilab/pylint/lint.py", line 
493, in astng_events
    self.astng_events(child, checkers)
  File "/usr/lib/python2.2/site-packages/logilab/pylint/lint.py", line 
493, in astng_events
    self.astng_events(child, checkers)
  File "/usr/lib/python2.2/site-packages/logilab/pylint/lint.py", line 
493, in astng_events
    self.astng_events(child, checkers)
  File "/usr/lib/python2.2/site-packages/logilab/pylint/lint.py", line 
490, in astng_events
    checker.visit(astng)
  File "/usr/lib/python2.2/site-packages/logilab/common/astng/utils.py", 
line 91, in visit
    method(node)
  File 
"/usr/lib/python2.2/site-packages/logilab/pylint/checkers/classes.py", 
line 193, in visit_function
    self._check_init(node)
  File 
"/usr/lib/python2.2/site-packages/logilab/pylint/checkers/classes.py", 
line 361, in _check_init
    to_call, unresolved = self._ancestors_to_call(node, klass_node)
  File 
"/usr/lib/python2.2/site-packages/logilab/pylint/checkers/classes.py", 
line 441, in _ancestors_to_call
    baseastng.get_method(method)
AttributeError: Getattr instance has no attribute 'get_method'

We're usign pylint v0.6.1 with the common library 0.9.1 and python2.2.2.
I have also tryed pylint 0.6.0 with the common library 0.9.0 and the 
situation is the same.

Do you have any suggestion?

Thank's in advance for your help,
    Alessandro Caproni


has reply