You've already forked python-uncompyle6
mirror of
https://github.com/rocky/python-uncompyle6.git
synced 2025-08-03 00:45:53 +08:00
Fix condition sense in except_handler.py reduction
This commit is contained in:
@@ -2,13 +2,15 @@
|
||||
|
||||
def except_handler(self, lhs, n, rule, ast, tokens, first, last):
|
||||
end_token = tokens[last-1]
|
||||
|
||||
# print("XXX", first, last)
|
||||
# for t in range(first, last):
|
||||
# print(tokens[t])
|
||||
# print("=" * 30)
|
||||
|
||||
# FIXME: Figure out why this doesn't work on
|
||||
# bytecode-1.4/anydbm.pyc
|
||||
if self.version != 1.4:
|
||||
if self.version == 1.4:
|
||||
return False
|
||||
|
||||
# Make sure come froms all come from within "except_handler".
|
||||
|
@@ -587,8 +587,7 @@ class SourceWalker(GenericASTTraversal, object):
|
||||
if n == "LOAD_CONST" and repr(n.pattr)[0] == "-":
|
||||
self.prec = 6
|
||||
|
||||
# print(n.kind, p, "<", self.prec)
|
||||
# print(self.f.getvalue())
|
||||
# print("XXX", n.kind, p, "<", self.prec)
|
||||
|
||||
if p < self.prec:
|
||||
self.write("(")
|
||||
@@ -604,7 +603,6 @@ class SourceWalker(GenericASTTraversal, object):
|
||||
# If expr is yield we want parens.
|
||||
self.prec = PRECEDENCE["yield"] - 1
|
||||
self.n_expr(node[0])
|
||||
p = self.prec
|
||||
else:
|
||||
self.n_expr(node)
|
||||
|
||||
|
Reference in New Issue
Block a user