diff --git a/test/bytecode_3.6/01_extended_arg.pyc b/test/bytecode_3.6/01_extended_arg.pyc index 80b8b573..e9297f13 100644 Binary files a/test/bytecode_3.6/01_extended_arg.pyc and b/test/bytecode_3.6/01_extended_arg.pyc differ diff --git a/test/bytecode_3.7/01_extended_arg.pyc b/test/bytecode_3.7/01_extended_arg.pyc index 6337ae35..ed32a996 100644 Binary files a/test/bytecode_3.7/01_extended_arg.pyc and b/test/bytecode_3.7/01_extended_arg.pyc differ diff --git a/test/simple_source/bug36/01_extended_arg.py b/test/simple_source/bug36/01_extended_arg.py index a2b4a3fb..59c4de69 100644 --- a/test/simple_source/bug36/01_extended_arg.py +++ b/test/simple_source/bug36/01_extended_arg.py @@ -13,62 +13,11 @@ def five(a): def test_ndarray_slice_multidim(a, f, listerr): for slices in a: - shape_t = 1 - shape_t = 1 - shape_t = 1 - shape_t = 1 - shape_t = 1 - shape_t = 1 - shape_t = 1 - shape_t = 1 - shape_t = 1 - shape_t = 1 - shape_t = 1 - shape_t = 1 - shape_t = 1 - shape_t = 1 - shape_t = 1 - shape_t = 1 - shape_t = 1 - shape_t = 1 - shape_t = 1 - shape_t = 1 - shape_t = 1 - shape_t = 1 - shape_t = 1 - shape_t = 1 - shape_t = 1 - shape_t = 1 - shape_t = 1 - shape_t = 1 - shape_t = 1 - shape_t = 1 - shape_t = 1 - shape_t = 1 - shape_t = 1 - shape_t = 1 - shape_t = 1 - shape_t = 1 - shape_t = 1 - shape_t = 1 - shape_t = 1 - shape_t = 1 - shape_t = 1 - shape_t = 1 - shape_t = 1 - shape_t = 1 - shape_t = 1 - shape_t = 1 - shape_t = 1 - shape_t = 1 - shape_t = 2 - shape_t = 3 - shape_t = 4 - shape_t = 5 - shape_t = 6 - shape_t = 7 - shape_t = 8 - shape_t = 9 + shape_t = 0; shape_t = 1; shape_t = 2; shape_t = 3; shape_t = 4; shape_t = 5; shape_t = 6; shape_t = 7; shape_t = 8; shape_t = 9 + shape_t = 0; shape_t = 1; shape_t = 2; shape_t = 3; shape_t = 4; shape_t = 5; shape_t = 6; shape_t = 7; shape_t = 8; shape_t = 9 + shape_t = 0; shape_t = 1; shape_t = 2; shape_t = 3; shape_t = 4; shape_t = 5; shape_t = 6; shape_t = 7; shape_t = 8; shape_t = 9 + shape_t = 0; shape_t = 1; shape_t = 2; shape_t = 3; shape_t = 4; shape_t = 5; shape_t = 6; shape_t = 7; shape_t = 8; shape_t = 9 + shape_t = 0; shape_t = 1; shape_t = 2; shape_t = 3; shape_t = 4; shape_t = 5; shape_t = 6; shape_t = 7; shape_t = 8; shape_t = 9 nderr = None if nderr or listerr: return f(5) @@ -77,3 +26,42 @@ def test_ndarray_slice_multidim(a, f, listerr): assert test_ndarray_slice_multidim([1], five, False) == 2 assert test_ndarray_slice_multidim([1], five, True) == 5 + +# From 3.7 test_builtin.py +def test_pow(self, m, a, b, c, f): + + shape_t = 0; shape_t = 1; shape_t = 2; shape_t = 3; shape_t = 4; shape_t = 5; shape_t = 6; shape_t = 7; shape_t = 8; shape_t = 9 + shape_t = 0; shape_t = 1; shape_t = 2; shape_t = 3; shape_t = 4; shape_t = 5; shape_t = 6; shape_t = 7; shape_t = 8; shape_t = 9 + shape_t = 0; shape_t = 1; shape_t = 2; shape_t = 3; shape_t = 4; shape_t = 5; shape_t = 6; shape_t = 7; shape_t = 8; shape_t = 9 + shape_t = 0; shape_t = 1; shape_t = 2; shape_t = 3; shape_t = 4; shape_t = 5; shape_t = 6; shape_t = 7; shape_t = 8; shape_t = 9 + shape_t = 0; shape_t = 1; shape_t = 2; shape_t = 3; shape_t = 4; shape_t = 5; shape_t = 6; shape_t = 7; shape_t = 8; shape_t = 9 + shape_t = 0; shape_t = 1; shape_t = 2; shape_t = 3; shape_t = 4; shape_t = 5; shape_t = 6; shape_t = 7; shape_t = 8; shape_t = 9 + + shape_t = 0; shape_t = 1; shape_t = 2; + + for z in m: + if a or \ + b or \ + c: + f(TypeError) + else: + x = 2 + + x = 3 + +# From 3.7 test_exceptions.py +# Bug is handling extended arg +def testAttributes(exceptionList): + try: + x = 0 + except: + pass + + for exc in exceptionList: + x = 0; x = 1; x = 2; x = 3; x = 4; x = 5; x = 6; x = 7; x = 8; x = 9; + x = 0; x = 1; x = 2; x = 3; x = 4; x = 5; x = 6; x = 7; x = 8; x = 9; + x = 0; x = 1; x = 2; x = 3; x = 4; x = 5; x = 6; x = 7; x = 8; x = 9; + x = 0; x = 1; x = 2; x = 3; x = 4; x = 5; x = 6; x = 7; x = 8; x = 9; + x = 0; x = 1; x = 2; x = 3; x = 4; x = 5; x = 6; x = 7; x = 8; x = 9; + x = 0; x = 1; x = 2; x = 3; x = 4; x = 5; x = 6; x = 7; x = 8; x = 9; + x = 0 diff --git a/uncompyle6/scanners/tok.py b/uncompyle6/scanners/tok.py index 7959672f..0cba8c12 100644 --- a/uncompyle6/scanners/tok.py +++ b/uncompyle6/scanners/tok.py @@ -55,7 +55,6 @@ class Token: else: self.offset = offset - self.offset = offset self.linestart = linestart if has_arg is False: self.attr = None @@ -165,7 +164,7 @@ class Token: def __getitem__(self, i): raise IndexError - def off2int(self): + def off2int(self, prefer_last=True): if isinstance(self.offset, int): return self.offset else: