summaryrefslogtreecommitdiffstats
path: root/Python
diff options
context:
space:
mode:
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>2019-07-01 11:29:14 (GMT)
committerƁukasz Langa <lukasz@langa.pl>2019-07-01 11:29:14 (GMT)
commitcb083f7cdf604c1d9d264f387f9e8846bc953eb3 (patch)
tree2a1e772b2085b26e80b62ce13d0fdd7962adfd2b /Python
parentf22c4cf11d10f52faa86e0b308dd28f11819efd8 (diff)
downloadcpython-cb083f7cdf604c1d9d264f387f9e8846bc953eb3.zip
cpython-cb083f7cdf604c1d9d264f387f9e8846bc953eb3.tar.gz
cpython-cb083f7cdf604c1d9d264f387f9e8846bc953eb3.tar.bz2
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 4a2edc34a405150d0b23ecfdcb401e7cf59f4650) Co-authored-by: Pablo Galindo <Pablogsal@gmail.com>
Diffstat (limited to 'Python')
-rw-r--r--Python/compile.c12
-rw-r--r--Python/marshal.c2
2 files changed, 6 insertions, 8 deletions
diff --git a/Python/compile.c b/Python/compile.c
index 7bdf406..9cce8ae 100644
--- a/Python/compile.c
+++ b/Python/compile.c
@@ -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);
diff --git a/Python/marshal.c b/Python/marshal.c
index caaddfe..b2daff2c 100644
--- a/Python/marshal.c
+++ b/Python/marshal.c
@@ -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,