summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_code.py
diff options
context:
space:
mode:
authorNikita Sobolev <mail@sobolevn.me>2023-04-03 15:35:04 (GMT)
committerGitHub <noreply@github.com>2023-04-03 15:35:04 (GMT)
commit2a721258a199e9bcdcee2069719ad9c8f8c0d030 (patch)
tree537143ffa297a94a60eb49c083252932a77d5773 /Lib/test/test_code.py
parente6f7d35be7fb65d8624e9411251554c9dee0c931 (diff)
downloadcpython-2a721258a199e9bcdcee2069719ad9c8f8c0d030.zip
cpython-2a721258a199e9bcdcee2069719ad9c8f8c0d030.tar.gz
cpython-2a721258a199e9bcdcee2069719ad9c8f8c0d030.tar.bz2
gh-101865: Deprecate `co_lnotab` from code objects as per PEP 626 (#101866)
Co-authored-by: Oleg Iarygin <oleg@arhadthedev.net>
Diffstat (limited to 'Lib/test/test_code.py')
-rw-r--r--Lib/test/test_code.py7
1 files changed, 7 insertions, 0 deletions
diff --git a/Lib/test/test_code.py b/Lib/test/test_code.py
index 0cd1fb3..7543c9a 100644
--- a/Lib/test/test_code.py
+++ b/Lib/test/test_code.py
@@ -338,6 +338,13 @@ class CodeTest(unittest.TestCase):
new_code = code = func.__code__.replace(co_linetable=b'')
self.assertEqual(list(new_code.co_lines()), [])
+ def test_co_lnotab_is_deprecated(self): # TODO: remove in 3.14
+ def func():
+ pass
+
+ with self.assertWarns(DeprecationWarning):
+ func.__code__.co_lnotab
+
def test_invalid_bytecode(self):
def foo():
pass