You've already forked python-uncompyle6
mirror of
https://github.com/rocky/python-uncompyle6.git
synced 2025-08-04 01:09:52 +08:00
parens around consts when taking attr again
This commit is contained in:
@@ -1889,6 +1889,17 @@ class SourceWalker(GenericASTTraversal, object):
|
||||
|
||||
n_set = n_tuple = n_build_set = n_list
|
||||
|
||||
def n_store(self, node):
|
||||
expr = node[0]
|
||||
if expr == "expr" and expr[0] == "LOAD_CONST" and node[1] == "STORE_ATTR":
|
||||
# FIXME: I didn't record which constants parenthesis is
|
||||
# necessary. However, I suspect that we could further
|
||||
# refine this by looking at operator precedence and
|
||||
# eval'ing the constant value (pattr) and comparing with
|
||||
# the type of the constant.
|
||||
node.kind = "store_w_parens"
|
||||
self.default(node)
|
||||
|
||||
def n_unpack(self, node):
|
||||
if node[0].kind.startswith("UNPACK_EX"):
|
||||
# Python 3+
|
||||
|
Reference in New Issue
Block a user