summaryrefslogtreecommitdiff
path: root/pylint/checkers/utils.py
diff options
context:
space:
mode:
authorDmitry Pribysh <dmand@yandex.ru>2015-10-27 18:03:15 +0300
committerDmitry Pribysh <dmand@yandex.ru>2015-10-27 18:03:15 +0300
commitdb975e2a316d41d52b46e0f7dcdcd2182530c213 (patch)
tree1d4ae8186073927c337f56babbf6ffd2bc1cb942 /pylint/checkers/utils.py
parent2dc6bd120c119b614018bca22ef96ff497ff5102 (diff)
downloadpylint-git-db975e2a316d41d52b46e0f7dcdcd2182530c213.tar.gz
Make iterable checker skip classes that are inferred to be abstract
--HG-- branch : fix-685
Diffstat (limited to 'pylint/checkers/utils.py')
-rw-r--r--pylint/checkers/utils.py11
1 files changed, 11 insertions, 0 deletions
diff --git a/pylint/checkers/utils.py b/pylint/checkers/utils.py
index 443e32d3e..8873d0e1b 100644
--- a/pylint/checkers/utils.py
+++ b/pylint/checkers/utils.py
@@ -573,6 +573,17 @@ def node_ignores_exception(node, exception):
return False
+def class_is_abstract(node):
+ """return true if the given class node should be considered as an abstract
+ class
+ """
+ for method in node.methods():
+ if method.parent.frame() is node:
+ if method.is_abstract(pass_is_abstract=False):
+ return True
+ return False
+
+
# TODO(cpopa): deprecate these or leave them as aliases?
safe_infer = astroid.helpers.safe_infer
has_known_bases = astroid.helpers.has_known_bases