summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLaura Médioni <laura.medioni@logilab.fr>2015-11-06 17:00:06 +0100
committerLaura Médioni <laura.medioni@logilab.fr>2015-11-06 17:00:06 +0100
commitcd5ad0987487cfe45a53f9d120b160ee2630f287 (patch)
tree6de609f593d94b10c32a2fd88c9e52d674e9654c
parent7bad9bc800fdcd8e0a52dc539401260cfe02484f (diff)
downloadpylint-git-cd5ad0987487cfe45a53f9d120b160ee2630f287.tar.gz
fix get_type()
It returned erroneous number of comment lines. tok_type is set just once, here one must look at the current token
-rw-r--r--pylint/checkers/raw_metrics.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/pylint/checkers/raw_metrics.py b/pylint/checkers/raw_metrics.py
index 1cfff831e..5846cd102 100644
--- a/pylint/checkers/raw_metrics.py
+++ b/pylint/checkers/raw_metrics.py
@@ -118,7 +118,7 @@ def get_type(tokens, start_index):
i += 1
if line_type is None:
line_type = 'empty_lines'
- elif i < len(tokens) and tok_type == tokenize.NEWLINE:
+ elif i < len(tokens) and tokens[i][0] == tokenize.NEWLINE:
i += 1
return i, pos[0] - start[0] + 1, line_type