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
commit187da8e7173408b98511d83d87c18a3c20bc6b21 (patch)
tree0794d9ba73e38692571be9d1a23e256a4dd85048
parent3614f72d4d1bb336e946a618f7e894f427118390 (diff)
downloadpylint-187da8e7173408b98511d83d87c18a3c20bc6b21.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 1cfff83..5846cd1 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