diff options
author | Laura M?dioni <laura.medioni@logilab.fr> | 2015-11-02 15:53:04 +0100 |
---|---|---|
committer | Laura M?dioni <laura.medioni@logilab.fr> | 2015-11-02 15:53:04 +0100 |
commit | 1d3704ade48ff95819e1a897af66c416d0bccaab (patch) | |
tree | 0cf57d98004db6836f2eb38a8664dd316e4ef797 | |
parent | 1dbe1d77c6ad956679a9cf0fd312f67cc75ff26b (diff) | |
download | pylint-1d3704ade48ff95819e1a897af66c416d0bccaab.tar.gz |
also count if nodes from ifexp and list comprehension
related to the issue #668
-rw-r--r-- | pylint/checkers/base.py | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/pylint/checkers/base.py b/pylint/checkers/base.py index 0ee5481..c9f0b0a 100644 --- a/pylint/checkers/base.py +++ b/pylint/checkers/base.py @@ -1690,6 +1690,13 @@ class ElifChecker(BaseTokenChecker): visit_while = visit_tryexcept visit_for = visit_while + def visit_ifexp(self, node): + self._if_counter += 1 + + def visit_comprehension(self, node): + for if_test in node.ifs: + self._if_counter += 1 + @check_messages('too-many-nested-blocks') def visit_if(self, node): self._check_nested_blocks(node) |