Fix condition sense in except_handler.py reduction

This commit is contained in:
rocky
2020-07-23 11:03:43 -04:00
parent a0f93f7ad9
commit 024a81c053
2 changed files with 4 additions and 4 deletions

View File

@@ -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".

View File

@@ -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)