mirror of
https://github.com/python/cpython.git
synced 2026-01-05 06:52:26 +00:00
bpo-37221: Add PyCode_NewWithPosOnlyArgs to be used internally and set PyCode_New as a compatibility wrapper (GH-13959) (#14505)
Add PyCode_NewEx to be used internally and set PyCode_New as a compatibility wrapper
(cherry picked from commit 4a2edc34a4)
Co-authored-by: Pablo Galindo <Pablogsal@gmail.com>
This commit is contained in:
parent
f22c4cf11d
commit
cb083f7cdf
8 changed files with 79 additions and 34 deletions
|
|
@ -5813,13 +5813,11 @@ makecode(struct compiler *c, struct assembler *a)
|
|||
if (maxdepth < 0) {
|
||||
goto error;
|
||||
}
|
||||
co = PyCode_New(posonlyargcount+posorkeywordargcount, posonlyargcount,
|
||||
kwonlyargcount, nlocals_int, maxdepth, flags,
|
||||
bytecode, consts, names, varnames,
|
||||
freevars, cellvars,
|
||||
c->c_filename, c->u->u_name,
|
||||
c->u->u_firstlineno,
|
||||
a->a_lnotab);
|
||||
co = PyCode_NewWithPosOnlyArgs(posonlyargcount+posorkeywordargcount,
|
||||
posonlyargcount, kwonlyargcount, nlocals_int,
|
||||
maxdepth, flags, bytecode, consts, names,
|
||||
varnames, freevars, cellvars, c->c_filename,
|
||||
c->u->u_name, c->u->u_firstlineno, a->a_lnotab);
|
||||
error:
|
||||
Py_XDECREF(consts);
|
||||
Py_XDECREF(names);
|
||||
|
|
|
|||
|
|
@ -1396,7 +1396,7 @@ r_object(RFILE *p)
|
|||
if (lnotab == NULL)
|
||||
goto code_error;
|
||||
|
||||
v = (PyObject *) PyCode_New(
|
||||
v = (PyObject *) PyCode_NewWithPosOnlyArgs(
|
||||
argcount, posonlyargcount, kwonlyargcount,
|
||||
nlocals, stacksize, flags,
|
||||
code, consts, names, varnames,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue