mirror of
https://github.com/jart/cosmopolitan.git
synced 2025-05-23 22:02:27 +00:00
Revert "Backport METH_FASTCALL from Python 3.7 (#328)"
This reverts commit cf73bbd678
.
This commit is contained in:
parent
e7611a8476
commit
2ea1dc405c
102 changed files with 3299 additions and 2894 deletions
12
third_party/python/Python/marshal.c
vendored
12
third_party/python/Python/marshal.c
vendored
|
@ -1688,7 +1688,7 @@ PyMarshal_WriteObjectToString(PyObject *x, int version)
|
|||
/* And an interface for Python programs... */
|
||||
|
||||
static PyObject *
|
||||
marshal_dump(PyObject *self, PyObject **args, Py_ssize_t nargs)
|
||||
marshal_dump(PyObject *self, PyObject **args, Py_ssize_t nargs, PyObject *kwnames)
|
||||
{
|
||||
/* XXX Quick hack -- need to do this differently */
|
||||
PyObject *x;
|
||||
|
@ -1700,6 +1700,8 @@ marshal_dump(PyObject *self, PyObject **args, Py_ssize_t nargs)
|
|||
|
||||
if (!_PyArg_ParseStack(args, nargs, "OO|i:dump", &x, &f, &version))
|
||||
return NULL;
|
||||
if (!_PyArg_NoStackKeywords("dump", kwnames))
|
||||
return NULL;
|
||||
|
||||
s = PyMarshal_WriteObjectToString(x, version);
|
||||
if (s == NULL)
|
||||
|
@ -1776,12 +1778,14 @@ dump(), load() will substitute None for the unmarshallable type.");
|
|||
|
||||
|
||||
static PyObject *
|
||||
marshal_dumps(PyObject *self, PyObject **args, Py_ssize_t nargs)
|
||||
marshal_dumps(PyObject *self, PyObject **args, Py_ssize_t nargs, PyObject *kwnames)
|
||||
{
|
||||
PyObject *x;
|
||||
int version = Py_MARSHAL_VERSION;
|
||||
if (!_PyArg_ParseStack(args, nargs, "O|i:dumps", &x, &version))
|
||||
return NULL;
|
||||
if(!_PyArg_NoStackKeywords("dumps", kwnames))
|
||||
return NULL;
|
||||
return PyMarshal_WriteObjectToString(x, version);
|
||||
}
|
||||
|
||||
|
@ -1796,7 +1800,7 @@ The version argument indicates the data format that dumps should use.");
|
|||
|
||||
|
||||
static PyObject *
|
||||
marshal_loads(PyObject *self, PyObject **args, Py_ssize_t nargs)
|
||||
marshal_loads(PyObject *self, PyObject **args, Py_ssize_t nargs, PyObject *kwnames)
|
||||
{
|
||||
RFILE rf;
|
||||
Py_buffer p;
|
||||
|
@ -1805,6 +1809,8 @@ marshal_loads(PyObject *self, PyObject **args, Py_ssize_t nargs)
|
|||
PyObject* result;
|
||||
if (!_PyArg_ParseStack(args, nargs, "y*:loads", &p))
|
||||
return NULL;
|
||||
if(!_PyArg_NoStackKeywords("loads", kwnames))
|
||||
return NULL;
|
||||
s = p.buf;
|
||||
n = p.len;
|
||||
rf.fp = NULL;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue