diff --git a/test/bytecode_3.1/12_if_while_true_pass.pyc b/test/bytecode_3.1/12_if_while_true_pass.pyc new file mode 100644 index 00000000..0adaa83a Binary files /dev/null and b/test/bytecode_3.1/12_if_while_true_pass.pyc differ diff --git a/test/bytecode_3.3/12_if_while_true_pass.pyc b/test/bytecode_3.3/12_if_while_true_pass.pyc new file mode 100644 index 00000000..c25fe3f5 Binary files /dev/null and b/test/bytecode_3.3/12_if_while_true_pass.pyc differ diff --git a/test/simple_source/looping/12_if_while_true_pass.py b/test/simple_source/looping/12_if_while_true_pass.py new file mode 100644 index 00000000..cf3bd1c5 --- /dev/null +++ b/test/simple_source/looping/12_if_while_true_pass.py @@ -0,0 +1,14 @@ +# Python 3.3 pyclbr.py +# Note that Python 3 adds a lot of unecessary "continues" +# and puts that in for "pass" +def _readmodule(g, token, path): + for tokentype in g: + if g: + while True: + if token: + token = 1 + elif token: + pass + elif tokentype: + token = 7 + token = 10 diff --git a/uncompyle6/scanners/scanner3.py b/uncompyle6/scanners/scanner3.py index 31953266..e347bb6b 100644 --- a/uncompyle6/scanners/scanner3.py +++ b/uncompyle6/scanners/scanner3.py @@ -338,11 +338,7 @@ class Scanner3(Scanner): (next_opname not in ('END_FINALLY', 'POP_BLOCK', # Python 3.0 only uses POP_TOP 'POP_TOP'))): - if (self.version >= 3.4 or - (inst.offset not in self.not_continue) or - (tokens[-1].type == 'RETURN_VALUE')): - opname = 'CONTINUE' - pass + opname = 'CONTINUE' else: opname = 'JUMP_BACK' # FIXME: this is a hack to catch stuff like: