Email [Python-projects] pylint bug ???

from
subject
[Python-projects] pylint bug ???
date
2004/03/26 15:10
Hi All,

The following file:

> cat test.py
class cool:
    class CoolException(Exception):
        def __init__(self, s):
            Exception.__init__(self, s)

    def __init__(self):
        pass


    def test(self):
        raise cool.CoolException("This is an exception string")

c = cool()
try:
    c.test()
except cool.CoolException:
    pass
>

results in the following:

C:\tmp>rem = """-*-Python-*- script
No config file found, using default configuration
************* Module test
W:  4: Found indentation with tabs instead of spaces
W:  0: Missing docstring
W:  0: Missing required attribute "__revision__"
W:  1:cool: Invalid name "cool" (should match [A-Z][a-zA-Z1-9]+)
W:  1:cool: Missing docstring
W:  2:cool.CoolException: Missing docstring
F:  3:cool.CoolException.__init__: Unable to resolve (Exception)
W:  3:cool.CoolException.__init__: Too short name "s"
W: 10:cool.test: Missing docstring
Traceback (most recent call last):
  File "C:\bin\pylint.bat", line 12, in ?
    lint.Run(sys.argv[1:])
  File "C:\python23\Lib\site-packages\logilab\pylint\lint.py", line 791, in
__init__
    linter.check(modnames)
  File "C:\python23\Lib\site-packages\logilab\pylint\lint.py", line 465, in
check
    self.check_module(mod_name, checkers, rev_checkers)
  File "C:\python23\Lib\site-packages\logilab\pylint\lint.py", line 478, in
check_module
    astng = self._check_module(mod_name, checkers, rev_checkers)
  File "C:\python23\Lib\site-packages\logilab\pylint\lint.py", line 501, in
_check_module
    self.check_astng_module(astng, checkers)
  File "C:\python23\Lib\site-packages\logilab\pylint\lint.py", line 540, in
check_astng_module
    self.astng_events(astng, [checker for checker in checkers
  File "C:\python23\Lib\site-packages\logilab\pylint\lint.py", line 557, in
astng_events
    self.astng_events(child, checkers)
  File "C:\python23\Lib\site-packages\logilab\pylint\lint.py", line 557, in
astng_events
    self.astng_events(child, checkers)
  File "C:\python23\Lib\site-packages\logilab\pylint\lint.py", line 560, in
astng_events
    checker.leave(astng)
  File "C:\python23\Lib\site-packages\logilab\common\astng\utils.py", line
82, in leave
    method(node)
  File "C:\python23\Lib\site-packages\logilab\pylint\checkers\classes.py",
line 168, in leave_class
    self.check_accessed_members(class_node)
  File "C:\python23\Lib\site-packages\logilab\pylint\checkers\classes.py",
line 225, in check_accessed_members
    for attr, nodes in self._accessed.items():
AttributeError: ClassChecker instance has no attribute '_accessed'

---------------------------
version info:

C:\tmp>rem = """-*-Python-*- script
No config file found, using default configuration
pylint.bat 0.3.3
Python 2.3.2 (#49, Oct  2 2003, 20:02:00) [MSC v.1200 32 bit (Intel)]


Non-nested classes works. I've not seen much python code with nested
classes, but python itself seems to work just fine.

---
Best Regards
Chris Hyser

_______________________________________________
Python-Projects mailing list
Python-Projects@lists.logilab.org
http://lists.logilab.org/mailman/listinfo/python-projects


has reply