Better docstring recognition

This commit is contained in:
rocky
2020-02-02 13:02:37 -05:00
parent 610994277c
commit 04f8619cf1
2 changed files with 9 additions and 0 deletions

View File

@@ -0,0 +1,4 @@
# From 2.7.17 fractions
"""Rational, infinite-precision, real numbers."""
from __future__ import division

View File

@@ -407,8 +407,13 @@ class TreeTransform(GenericASTTraversal, object):
pass pass
except: except:
pass pass
try: try:
for i in range(len(self.ast)): for i in range(len(self.ast)):
sstmt = ast[i]
if len(sstmt) == 1 and sstmt == "sstmt":
ast[i] = ast[i][0]
if is_docstring(self.ast[i]): if is_docstring(self.ast[i]):
docstring_ast = SyntaxTree( docstring_ast = SyntaxTree(
"docstring", "docstring",