diff options
| author | Nikita Sobolev <mail@sobolevn.me> | 2023-04-03 18:35:04 +0300 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2023-04-03 17:35:04 +0200 |
| commit | 2a721258a199e9bcdcee2069719ad9c8f8c0d030 (patch) | |
| tree | 537143ffa297a94a60eb49c083252932a77d5773 /Lib/test/test_code.py | |
| parent | e6f7d35be7fb65d8624e9411251554c9dee0c931 (diff) | |
| download | cpython-git-2a721258a199e9bcdcee2069719ad9c8f8c0d030.tar.gz | |
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.py | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/Lib/test/test_code.py b/Lib/test/test_code.py index 0cd1fb3f97..7543c9ab34 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 |
