diff options
author | Ned Batchelder <ned@nedbatchelder.com> | 2016-01-11 06:23:37 -0500 |
---|---|---|
committer | Ned Batchelder <ned@nedbatchelder.com> | 2016-01-11 06:23:37 -0500 |
commit | 866d3f9fe853de9da6ee456a4ed5aa1cfa453e1f (patch) | |
tree | aee0e4de8c01690e5e9de4a08ba5d3ef9aa0b12a /coverage/parser.py | |
parent | d985f6852634cccc03d020b5a2cc425f74ae2f8c (diff) | |
download | python-coveragepy-git-866d3f9fe853de9da6ee456a4ed5aa1cfa453e1f.tar.gz |
Class docstrings shouldn't be considered executable. Not sure what happened there...
Diffstat (limited to 'coverage/parser.py')
-rw-r--r-- | coverage/parser.py | 5 |
1 files changed, 1 insertions, 4 deletions
diff --git a/coverage/parser.py b/coverage/parser.py index 4a7bab54..f0bfe614 100644 --- a/coverage/parser.py +++ b/coverage/parser.py @@ -125,7 +125,6 @@ class PythonParser(object): excluding = False excluding_decorators = False prev_toktype = token.INDENT - last_name = None first_line = None empty = True first_on_line = True @@ -147,7 +146,6 @@ class PythonParser(object): # we need to exclude them. The simplest way is to note the # lines with the 'class' keyword. self.raw_classdefs.add(slineno) - last_name = ttext elif toktype == token.OP: if ttext == ':': should_exclude = (elineno in self.raw_excluded) or excluding_decorators @@ -170,8 +168,7 @@ class PythonParser(object): # (a trick from trace.py in the stdlib.) This works for # 99.9999% of cases. For the rest (!) see: # http://stackoverflow.com/questions/1769332/x/1769794#1769794 - if last_name == 'def': - self.raw_docstrings.update(range(slineno, elineno+1)) + self.raw_docstrings.update(range(slineno, elineno+1)) elif toktype == token.NEWLINE: if first_line is not None and elineno != first_line: # We're at the end of a line, and we've ended on a |