summaryrefslogtreecommitdiff
path: root/Python/marshal.c
diff options
context:
space:
mode:
authorPablo Galindo <Pablogsal@gmail.com>2019-04-29 13:36:57 +0100
committerGitHub <noreply@github.com>2019-04-29 13:36:57 +0100
commit8c77b8cb9188165a123f2512026e3629bf03dc9b (patch)
tree863ea19f5f2c8ec179c32b3d06dc8366859ae26e /Python/marshal.c
parent99fcc616d400cd31af0733c3f8cc93bcc1d32a44 (diff)
downloadcpython-git-8c77b8cb9188165a123f2512026e3629bf03dc9b.tar.gz
bpo-36540: PEP 570 -- Implementation (GH-12701)
This commit contains the implementation of PEP570: Python positional-only parameters. * Update Grammar/Grammar with new typedarglist and varargslist * Regenerate grammar files * Update and regenerate AST related files * Update code object * Update marshal.c * Update compiler and symtable * Regenerate importlib files * Update callable objects * Implement positional-only args logic in ceval.c * Regenerate frozen data * Update standard library to account for positional-only args * Add test file for positional-only args * Update other test files to account for positional-only args * Add News entry * Update inspect module and related tests
Diffstat (limited to 'Python/marshal.c')
-rw-r--r--Python/marshal.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/Python/marshal.c b/Python/marshal.c
index 52932af225..caaddfe9e4 100644
--- a/Python/marshal.c
+++ b/Python/marshal.c
@@ -530,6 +530,7 @@ w_complex_object(PyObject *v, char flag, WFILE *p)
PyCodeObject *co = (PyCodeObject *)v;
W_TYPE(TYPE_CODE, p);
w_long(co->co_argcount, p);
+ w_long(co->co_posonlyargcount, p);
w_long(co->co_kwonlyargcount, p);
w_long(co->co_nlocals, p);
w_long(co->co_stacksize, p);
@@ -1322,6 +1323,7 @@ r_object(RFILE *p)
case TYPE_CODE:
{
int argcount;
+ int posonlyargcount;
int kwonlyargcount;
int nlocals;
int stacksize;
@@ -1347,6 +1349,10 @@ r_object(RFILE *p)
argcount = (int)r_long(p);
if (PyErr_Occurred())
goto code_error;
+ posonlyargcount = (int)r_long(p);
+ if (PyErr_Occurred()) {
+ goto code_error;
+ }
kwonlyargcount = (int)r_long(p);
if (PyErr_Occurred())
goto code_error;
@@ -1391,7 +1397,7 @@ r_object(RFILE *p)
goto code_error;
v = (PyObject *) PyCode_New(
- argcount, kwonlyargcount,
+ argcount, posonlyargcount, kwonlyargcount,
nlocals, stacksize, flags,
code, consts, names, varnames,
freevars, cellvars, filename, name,