summaryrefslogtreecommitdiff
path: root/checkers/utils.py
diff options
context:
space:
mode:
authorSylvain <syt@logilab.fr>2007-02-17 11:00:37 +0100
committerSylvain <syt@logilab.fr>2007-02-17 11:00:37 +0100
commit2f68889ad9dcae449754e8ff60320215602bcf48 (patch)
tree34036be152c76e13cbd8fce41942a56eac49ad4d /checkers/utils.py
parent8345704718dd424ddcd704ad2c02132318e89e3b (diff)
downloadpylint-2f68889ad9dcae449754e8ff60320215602bcf48.tar.gz
fix #3205: W0704 false positive
Diffstat (limited to 'checkers/utils.py')
-rw-r--r--checkers/utils.py7
1 files changed, 2 insertions, 5 deletions
diff --git a/checkers/utils.py b/checkers/utils.py
index 580081a..575a715 100644
--- a/checkers/utils.py
+++ b/checkers/utils.py
@@ -71,11 +71,8 @@ def is_raising(stmt):
def is_empty(node):
"""return true if the given node does nothing but 'pass'"""
- for child_node in node.getChildNodes():
- if isinstance(child_node, astng.Pass):
- return True
- else:
- return False
+ children = node.getChildNodes()
+ return len(children) == 1 and isinstance(children[0], astng.Pass)
builtins = __builtins__.copy()
SPECIAL_BUILTINS = ('__builtins__',) # '__path__', '__file__')