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:
Nikita Sobolev 2023-04-03 18:35:04 +03:00 committed by GitHub
parent e6f7d35be7
commit 2a721258a1
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 22 additions and 1 deletions

View file

@ -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);
}