mirror of
https://github.com/python/cpython.git
synced 2025-11-30 14:59:12 +00:00
Backed out changeset 6ceedbd88b5f
This commit is contained in:
parent
b78c448f4b
commit
e1e04ad8aa
2 changed files with 6 additions and 22 deletions
|
|
@ -89,15 +89,13 @@ a ValueError. Other possible values are 'ignore', 'replace' and\n\
|
|||
codecs.register_error that can handle ValueErrors.");
|
||||
|
||||
static PyObject *
|
||||
codec_encode(PyObject *self, PyObject *args, PyObject *kwargs)
|
||||
codec_encode(PyObject *self, PyObject *args)
|
||||
{
|
||||
static char *kwlist[] = {"obj", "encoding", "errors", NULL};
|
||||
const char *encoding = NULL;
|
||||
const char *errors = NULL;
|
||||
PyObject *v;
|
||||
|
||||
if (!PyArg_ParseTupleAndKeywords(args, kwargs, "O|ss:encode", kwlist,
|
||||
&v, &encoding, &errors))
|
||||
if (!PyArg_ParseTuple(args, "O|ss:encode", &v, &encoding, &errors))
|
||||
return NULL;
|
||||
|
||||
if (encoding == NULL)
|
||||
|
|
@ -118,15 +116,13 @@ as well as any other name registered with codecs.register_error that is\n\
|
|||
able to handle ValueErrors.");
|
||||
|
||||
static PyObject *
|
||||
codec_decode(PyObject *self, PyObject *args, PyObject *kwargs)
|
||||
codec_decode(PyObject *self, PyObject *args)
|
||||
{
|
||||
static char *kwlist[] = {"obj", "encoding", "errors", NULL};
|
||||
const char *encoding = NULL;
|
||||
const char *errors = NULL;
|
||||
PyObject *v;
|
||||
|
||||
if (!PyArg_ParseTupleAndKeywords(args, kwargs, "O|ss:decode", kwlist,
|
||||
&v, &encoding, &errors))
|
||||
if (!PyArg_ParseTuple(args, "O|ss:decode", &v, &encoding, &errors))
|
||||
return NULL;
|
||||
|
||||
if (encoding == NULL)
|
||||
|
|
@ -1124,9 +1120,9 @@ static PyMethodDef _codecs_functions[] = {
|
|||
register__doc__},
|
||||
{"lookup", codec_lookup, METH_VARARGS,
|
||||
lookup__doc__},
|
||||
{"encode", (PyCFunction)codec_encode, METH_VARARGS|METH_KEYWORDS,
|
||||
{"encode", codec_encode, METH_VARARGS,
|
||||
encode__doc__},
|
||||
{"decode", (PyCFunction)codec_decode, METH_VARARGS|METH_KEYWORDS,
|
||||
{"decode", codec_decode, METH_VARARGS,
|
||||
decode__doc__},
|
||||
{"escape_encode", escape_encode, METH_VARARGS},
|
||||
{"escape_decode", escape_decode, METH_VARARGS},
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue