summaryrefslogtreecommitdiffstats
path: root/Python/marshal.c
diff options
context:
space:
mode:
authorGabriele N. Tornetta <P403n1x87@users.noreply.github.com>2021-07-07 11:21:51 (GMT)
committerGitHub <noreply@github.com>2021-07-07 11:21:51 (GMT)
commit2f180ce2cb6e6a7e3c517495e0f4873d6aaf5f2f (patch)
tree446776f951c764ef32fbe91e80c7928be0fe54b4 /Python/marshal.c
parent32096df0e00e692ee6dc688e62213bff0dffd573 (diff)
downloadcpython-2f180ce2cb6e6a7e3c517495e0f4873d6aaf5f2f.zip
cpython-2f180ce2cb6e6a7e3c517495e0f4873d6aaf5f2f.tar.gz
cpython-2f180ce2cb6e6a7e3c517495e0f4873d6aaf5f2f.tar.bz2
bpo-44530: Add co_qualname field to PyCodeObject (GH-26941)
Diffstat (limited to 'Python/marshal.c')
-rw-r--r--Python/marshal.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/Python/marshal.c b/Python/marshal.c
index d7fdb83..1260704 100644
--- a/Python/marshal.c
+++ b/Python/marshal.c
@@ -522,6 +522,7 @@ w_complex_object(PyObject *v, char flag, WFILE *p)
w_object(co->co_localspluskinds, p);
w_object(co->co_filename, p);
w_object(co->co_name, p);
+ w_object(co->co_qualname, p);
w_long(co->co_firstlineno, p);
w_object(co->co_linetable, p);
w_object(co->co_endlinetable, p);
@@ -1315,6 +1316,7 @@ r_object(RFILE *p)
PyObject *localspluskinds = NULL;
PyObject *filename = NULL;
PyObject *name = NULL;
+ PyObject *qualname = NULL;
int firstlineno;
PyObject *linetable = NULL;
PyObject* endlinetable = NULL;
@@ -1365,6 +1367,9 @@ r_object(RFILE *p)
name = r_object(p);
if (name == NULL)
goto code_error;
+ qualname = r_object(p);
+ if (qualname == NULL)
+ goto code_error;
firstlineno = (int)r_long(p);
if (firstlineno == -1 && PyErr_Occurred())
break;
@@ -1384,6 +1389,7 @@ r_object(RFILE *p)
struct _PyCodeConstructor con = {
.filename = filename,
.name = name,
+ .qualname = qualname,
.flags = flags,
.code = code,
@@ -1426,6 +1432,7 @@ r_object(RFILE *p)
Py_XDECREF(localspluskinds);
Py_XDECREF(filename);
Py_XDECREF(name);
+ Py_XDECREF(qualname);
Py_XDECREF(linetable);
Py_XDECREF(endlinetable);
Py_XDECREF(columntable);