summaryrefslogtreecommitdiffstats
path: root/Lib/test
diff options
context:
space:
mode:
Diffstat (limited to 'Lib/test')
-rw-r--r--Lib/test/test_code.py6
-rw-r--r--Lib/test/test_dis.py2
2 files changed, 7 insertions, 1 deletions
diff --git a/Lib/test/test_code.py b/Lib/test/test_code.py
index 467e8e5..6aaf04c 100644
--- a/Lib/test/test_code.py
+++ b/Lib/test/test_code.py
@@ -264,6 +264,12 @@ class CodeTest(unittest.TestCase):
new_code = code.replace(**{attr: value})
self.assertEqual(getattr(new_code, attr), value)
+ def test_empty_linetable(self):
+ def func():
+ pass
+ new_code = code = func.__code__.replace(co_linetable=b'')
+ self.assertEqual(list(new_code.co_lines()), [])
+
def isinterned(s):
return s is sys.intern(('_' + s + '_')[1:-1])
diff --git a/Lib/test/test_dis.py b/Lib/test/test_dis.py
index 8e36ae2..8d05935 100644
--- a/Lib/test/test_dis.py
+++ b/Lib/test/test_dis.py
@@ -172,7 +172,7 @@ def bug42562():
# Set line number for 'pass' to None
-bug42562.__code__ = bug42562.__code__.replace(co_linetable=b'\x04\x80\xff\x80')
+bug42562.__code__ = bug42562.__code__.replace(co_linetable=b'\x04\x80')
dis_bug42562 = """\