Skip to content

Commit

Permalink
remove checking of node.docstring (#704)
Browse files Browse the repository at this point in the history
this was only present during a brief period of 3.7 pre-release
  • Loading branch information
asottile committed May 30, 2022
1 parent 405a090 commit 5959216
Showing 1 changed file with 1 addition and 13 deletions.
14 changes: 1 addition & 13 deletions pyflakes/checker.py
Expand Up @@ -1439,19 +1439,7 @@ def handleNode(self, node, parent):

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
Expand Down

0 comments on commit 5959216

Please sign in to comment.