mirror of
https://github.com/python/cpython.git
synced 2025-08-22 17:55:18 +00:00
gh-101865: Deprecate co_lnotab
from code objects as per PEP 626 (#101866)
Co-authored-by: Oleg Iarygin <oleg@arhadthedev.net>
This commit is contained in:
parent
e6f7d35be7
commit
2a721258a1
5 changed files with 22 additions and 1 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue