Skip to content

Commit f9e135e

Browse files
authored
Revert "pythongh-94816: Improve coverage of decode_linetable (pythonGH-94853)"
This reverts commit 20b9d2a.
1 parent a25a803 commit f9e135e

File tree

1 file changed

+0
-23
lines changed

1 file changed

+0
-23
lines changed

Lib/test/test_code.py

-23
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@
1717
freevars: ()
1818
nlocals: 2
1919
flags: 3
20-
lnotab: [4, 1, 10, 2]
2120
consts: ('None', '<code object g>')
2221
2322
>>> dump(f(4).__code__)
@@ -31,7 +30,6 @@
3130
freevars: ('x',)
3231
nlocals: 1
3332
flags: 19
34-
lnotab: [4, 1]
3533
consts: ('None',)
3634
3735
>>> def h(x, y):
@@ -52,7 +50,6 @@
5250
freevars: ()
5351
nlocals: 5
5452
flags: 3
55-
lnotab: [2, 1, 10, 1, 10, 1, 10, 1]
5653
consts: ('None',)
5754
5855
>>> def attrs(obj):
@@ -71,7 +68,6 @@
7168
freevars: ()
7269
nlocals: 1
7370
flags: 3
74-
lnotab: [2, 1, 46, 1, 46, 1]
7571
consts: ('None',)
7672
7773
>>> def optimize_away():
@@ -91,7 +87,6 @@
9187
freevars: ()
9288
nlocals: 0
9389
flags: 3
94-
lnotab: [2, 2, 2, 1, 2, 1]
9590
consts: ("'doc string'", 'None')
9691
9792
>>> def keywordonly_args(a,b,*,k1):
@@ -109,7 +104,6 @@
109104
freevars: ()
110105
nlocals: 3
111106
flags: 3
112-
lnotab: [2, 1]
113107
consts: ('None',)
114108
115109
>>> def posonly_args(a,b,/,c):
@@ -127,7 +121,6 @@
127121
freevars: ()
128122
nlocals: 3
129123
flags: 3
130-
lnotab: [2, 1]
131124
consts: ('None',)
132125
133126
"""
@@ -168,7 +161,6 @@ def dump(co):
168161
"kwonlyargcount", "names", "varnames",
169162
"cellvars", "freevars", "nlocals", "flags"]:
170163
print("%s: %s" % (attr, getattr(co, "co_" + attr)))
171-
print("lnotab:", list(co.co_lnotab))
172164
print("consts:", tuple(consts(co.co_consts)))
173165

174166
# Needed for test_closure_injection below
@@ -436,21 +428,6 @@ def func():
436428
self.assertIsNone(line)
437429
self.assertEqual(end_line, new_code.co_firstlineno + 1)
438430

439-
def test_large_lnotab(self):
440-
d = {}
441-
lines = (
442-
["def f():"] +
443-
[""] * (1 << 17) +
444-
[" pass"] * (1 << 17)
445-
)
446-
source = "\n".join(lines)
447-
exec(source, d)
448-
code = d["f"].__code__
449-
450-
expected = 1032 * [0, 127] + [0, 9] + ((1 << 17) - 1) * [2, 1]
451-
expected[0] = 2
452-
self.assertEqual(list(code.co_lnotab), expected)
453-
454431

455432
def isinterned(s):
456433
return s is sys.intern(('_' + s + '_')[1:-1])

0 commit comments

Comments
 (0)