Showing
1 changed file
with
1 additions
and
1 deletions
... | @@ -116,7 +116,7 @@ class ASTPrinterVisitor(Visitor): | ... | @@ -116,7 +116,7 @@ class ASTPrinterVisitor(Visitor): |
116 | for key in dir(node): | 116 | for key in dir(node): |
117 | if key[0] == '_': | 117 | if key[0] == '_': |
118 | continue | 118 | continue |
119 | - val = node.__dict__[key] | 119 | + val = getattr(node, key, None) |
120 | if (isinstance(val, str) or | 120 | if (isinstance(val, str) or |
121 | isinstance(val, int)): | 121 | isinstance(val, int)): |
122 | self.p(" %s: %s" % (key, str(val))) | 122 | self.p(" %s: %s" % (key, str(val))) | ... | ... |
-
Please register or login to post a comment