diff options
author | Anthony Sottile <asottile@umich.edu> | 2022-05-30 16:52:37 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-05-30 16:52:37 -0400 |
commit | 5959216f67837f3ddf5b959c21e097c7a3758d48 (patch) | |
tree | 1492dd53e4f869b7a95dfe00cc9ed4c86431eb59 | |
parent | 405a0906c8debafaae419472d3f51b84b7ba5c49 (diff) | |
download | pyflakes-5959216f67837f3ddf5b959c21e097c7a3758d48.tar.gz |
remove checking of node.docstring (#704)
this was only present during a brief period of 3.7 pre-release
-rw-r--r-- | pyflakes/checker.py | 14 |
1 files changed, 1 insertions, 13 deletions
diff --git a/pyflakes/checker.py b/pyflakes/checker.py index 0da87c2..2cb0e3c 100644 --- a/pyflakes/checker.py +++ b/pyflakes/checker.py @@ -1439,19 +1439,7 @@ class Checker(object): def handleDoctests(self, node): try: - if hasattr(node, 'docstring'): - docstring = node.docstring - - # This is just a reasonable guess. In Python 3.7, docstrings no - # longer have line numbers associated with them. This will be - # incorrect if there are empty lines between the beginning - # of the function and the docstring. - node_lineno = node.lineno - if hasattr(node, 'args'): - node_lineno = max([node_lineno] + - [arg.lineno for arg in node.args.args]) - else: - (docstring, node_lineno) = self.getDocstring(node.body[0]) + (docstring, node_lineno) = self.getDocstring(node.body[0]) examples = docstring and self._getDoctestExamples(docstring) except (ValueError, IndexError): # e.g. line 6 of the docstring for <string> has inconsistent |