diff options
author | Sylvain <syt@logilab.fr> | 2007-02-17 11:00:37 +0100 |
---|---|---|
committer | Sylvain <syt@logilab.fr> | 2007-02-17 11:00:37 +0100 |
commit | 2f68889ad9dcae449754e8ff60320215602bcf48 (patch) | |
tree | 34036be152c76e13cbd8fce41942a56eac49ad4d /checkers/utils.py | |
parent | 8345704718dd424ddcd704ad2c02132318e89e3b (diff) | |
download | pylint-2f68889ad9dcae449754e8ff60320215602bcf48.tar.gz |
fix #3205: W0704 false positive
Diffstat (limited to 'checkers/utils.py')
-rw-r--r-- | checkers/utils.py | 7 |
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__') |