diff --git a/uncompyle6/semantics/transform.py b/uncompyle6/semantics/transform.py index 1a419462..f4b6223b 100644 --- a/uncompyle6/semantics/transform.py +++ b/uncompyle6/semantics/transform.py @@ -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, ) ], )