You've already forked python-uncompyle6
mirror of
https://github.com/rocky/python-uncompyle6.git
synced 2025-08-03 00:45:53 +08:00
3.7+ bug in handling extended arg
This commit is contained in:
Binary file not shown.
Binary file not shown.
@@ -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
|
||||
|
@@ -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:
|
||||
|
Reference in New Issue
Block a user