Closed pylint-bot closed 8 years ago
Original comment by Claudiu Popa (BitBucket: PCManticore, GitHub: @PCManticore):
Fix a crash which occurred when old visit methods are encountered in plugin modules.
If a plugin uses an old visit method (visit_class for instance), this can lead to a crash in pylint's base checkers, because the logic in the PylintASTWalker assumes that all checkers have a visit_class / leave_class method. The patch fixes this by looking for both names. Closes issue #711.
Original comment by Claudiu Popa (BitBucket: PCManticore, GitHub: @PCManticore):
Fix a crash which occurred when old visit methods are encountered in plugin modules.
If a plugin uses an old visit method (visit_class for instance), this can lead to a crash in pylint's base checkers, because the logic in the PylintASTWalker assumes that all checkers have a visit_class / leave_class method. The patch fixes this by looking for both names. Closes issue #711.
Original comment by Claudiu Popa (BitBucket: PCManticore, GitHub: @PCManticore):
Should be fixed, I'll try to push a new bug fix release later today or earlier tomorrow. Please tell if it works for you or if you have other problems with this release.
Original comment by Florian Bruhin (BitBucket: The-Compiler, GitHub: @The-Compiler?):
Issue #713 was marked as a duplicate of this issue.
Originally reported by: BitBucket: carlio, GitHub: @carlio?
I created a custom checker for a pylint plugin here: https://github.com/landscapeio/pylint-django/blob/master/pylint_django/checkers/models.py
Recently methods for visiting nodes changed: https://bitbucket.org/logilab/pylint/commits/c94ee95abaa5737f13b91626fe321150c0ddd140
visit_class
should now bevisit_classdef
When my checker still defines a
visit_class
method, then the logic in thePylintASTWalker
assumes that all checkers have avisit_class
method: https://bitbucket.org/logilab/pylint/src/0c2ba769319f426dd38a00dc9cc7e61a01848b30/pylint/utils.py?at=default&fileviewer=file-view-default#utils.py-898This means that
visit_classdef
is not called for any of the built-in pylint checkers, especially the ClassChecker which breaks (as_accessed
does not get populated)