Fix broken __doc__ transform yet again...

Hopefully by using first_child() we have something more robust now.
This commit is contained in:
rocky
2020-06-17 10:12:56 -04:00
parent d357898bbf
commit 2a8daca25d

View File

@@ -433,6 +433,7 @@ class TreeTransform(GenericASTTraversal, object):
ast[i] = ast[i][0]
if is_docstring(self.ast[i]):
load_const = self.ast[i].first_child()
docstring_ast = SyntaxTree(
"docstring",
[
@@ -440,8 +441,8 @@ class TreeTransform(GenericASTTraversal, object):
"LOAD_STR",
has_arg=True,
offset=0,
attr=self.ast[i][0][0].attr,
pattr=self.ast[i][0][0].pattr,
attr=load_const.attr,
pattr=load_const.pattr,
)
],
)