From de36d67b7d94940ee61b22e9c90da80954443ce7 Mon Sep 17 00:00:00 2001 From: Anthony Sottile Date: Mon, 30 May 2022 16:45:33 -0400 Subject: [PATCH] remove checking of node.docstring this was only present during a brief period of 3.7 pre-release --- pyflakes/checker.py | 14 +------------- 1 file changed, 1 insertion(+), 13 deletions(-) diff --git a/pyflakes/checker.py b/pyflakes/checker.py index 0da87c27..2cb0e3cc 100644 --- a/pyflakes/checker.py +++ b/pyflakes/checker.py @@ -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 has inconsistent