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 /Objects/codeobject.c | |
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 'Objects/codeobject.c')
-rw-r--r-- | Objects/codeobject.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/Objects/codeobject.c b/Objects/codeobject.c index 65b1d258fb..755d0b85e7 100644 --- a/Objects/codeobject.c +++ b/Objects/codeobject.c @@ -1921,6 +1921,11 @@ static PyMemberDef code_memberlist[] = { static PyObject * code_getlnotab(PyCodeObject *code, void *closure) { + if (PyErr_WarnEx(PyExc_DeprecationWarning, + "co_lnotab is deprecated, use co_lines instead.", + 1) < 0) { + return NULL; + } return decode_linetable(code); } |