Skip to content

Commit

Permalink
opc field in while1 reduction is off of token...
Browse files Browse the repository at this point in the history
not self (parse)
  • Loading branch information
rocky committed Nov 5, 2022
1 parent 647df71 commit 207dc0b
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
Binary file added test/bytecode_3.7/02_while1_if_while1.pyc
Binary file not shown.
4 changes: 2 additions & 2 deletions uncompyle6/parsers/reducecheck/while1stmt.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright (c) 2020 Rocky Bernstein
# Copyright (c) 2020, 2022 Rocky Bernstein


def while1stmt(self, lhs, n, rule, ast, tokens, first, last):
Expand Down Expand Up @@ -42,7 +42,7 @@ def while1stmt(self, lhs, n, rule, ast, tokens, first, last):
# token could be a pseudo-op like "LOAD_STR", which is not in
# self.opc. We will replace that with LOAD_CONST as an
# example of an instruction that is not in self.opc.JUMP_OPS
if self.opc.opmap.get(token.kind, "LOAD_CONST") in self.opc.JUMP_OPS:
if token.opc.opmap.get(token.kind, "LOAD_CONST") in self.opc.JUMP_OPS:
if token.attr >= loop_end_offset:
return True

Expand Down

0 comments on commit 207dc0b

Please sign in to comment.