mirror of
https://github.com/python/cpython.git
synced 2025-10-09 16:34:44 +00:00
bpo-44530: Add co_qualname field to PyCodeObject (GH-26941)
This commit is contained in:
parent
32096df0e0
commit
2f180ce2cb
20 changed files with 7457 additions and 7444 deletions
|
@ -1195,7 +1195,7 @@ stack_effect(int opcode, int oparg, int jump)
|
|||
case CALL_FUNCTION_EX:
|
||||
return -1 - ((oparg & 0x01) != 0);
|
||||
case MAKE_FUNCTION:
|
||||
return -1 - ((oparg & 0x01) != 0) - ((oparg & 0x02) != 0) -
|
||||
return 0 - ((oparg & 0x01) != 0) - ((oparg & 0x02) != 0) -
|
||||
((oparg & 0x04) != 0) - ((oparg & 0x08) != 0);
|
||||
case BUILD_SLICE:
|
||||
if (oparg == 3)
|
||||
|
@ -2138,7 +2138,6 @@ compiler_make_closure(struct compiler *c, PyCodeObject *co, Py_ssize_t flags,
|
|||
ADDOP_I(c, BUILD_TUPLE, co->co_nfreevars);
|
||||
}
|
||||
ADDOP_LOAD_CONST(c, (PyObject*)co);
|
||||
ADDOP_LOAD_CONST(c, qualname);
|
||||
ADDOP_I(c, MAKE_FUNCTION, flags);
|
||||
return 1;
|
||||
}
|
||||
|
@ -7389,7 +7388,6 @@ makecode(struct compiler *c, struct assembler *a, PyObject *constslist,
|
|||
PyObject *consts = NULL;
|
||||
PyObject *localsplusnames = NULL;
|
||||
PyObject *localspluskinds = NULL;
|
||||
PyObject *name = NULL;
|
||||
|
||||
names = dict_keys_inorder(c->u->u_names, 0);
|
||||
if (!names) {
|
||||
|
@ -7433,6 +7431,7 @@ makecode(struct compiler *c, struct assembler *a, PyObject *constslist,
|
|||
struct _PyCodeConstructor con = {
|
||||
.filename = c->c_filename,
|
||||
.name = c->u->u_name,
|
||||
.qualname = c->u->u_qualname ? c->u->u_qualname : c->u->u_name,
|
||||
.flags = flags,
|
||||
|
||||
.code = a->a_bytecode,
|
||||
|
@ -7475,7 +7474,6 @@ makecode(struct compiler *c, struct assembler *a, PyObject *constslist,
|
|||
Py_XDECREF(consts);
|
||||
Py_XDECREF(localsplusnames);
|
||||
Py_XDECREF(localspluskinds);
|
||||
Py_XDECREF(name);
|
||||
return co;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue