diff options
author | Guido van Rossum <guido@python.org> | 2007-05-03 17:49:24 +0000 |
---|---|---|
committer | Guido van Rossum <guido@python.org> | 2007-05-03 17:49:24 +0000 |
commit | 8d30cc0144a6a94e06f3a115b07afa6314466cfd (patch) | |
tree | 0c0b2f3d75cca4173ec3e8e2962682affbd2e886 /Modules/_codecsmodule.c | |
parent | 938ef57e267838dcfbfb0d51d9bd40caece1c5db (diff) | |
download | cpython-git-8d30cc0144a6a94e06f3a115b07afa6314466cfd.tar.gz |
Get rid of all #ifdef Py_USING_UNICODE (it is always present now).
(With the help of unifdef from freshmeat.)
Diffstat (limited to 'Modules/_codecsmodule.c')
-rw-r--r-- | Modules/_codecsmodule.c | 18 |
1 files changed, 0 insertions, 18 deletions
diff --git a/Modules/_codecsmodule.c b/Modules/_codecsmodule.c index 4dbceb78be..b165f970ee 100644 --- a/Modules/_codecsmodule.c +++ b/Modules/_codecsmodule.c @@ -93,15 +93,8 @@ codec_encode(PyObject *self, PyObject *args) if (!PyArg_ParseTuple(args, "O|ss:encode", &v, &encoding, &errors)) return NULL; -#ifdef Py_USING_UNICODE if (encoding == NULL) encoding = PyUnicode_GetDefaultEncoding(); -#else - if (encoding == NULL) { - PyErr_SetString(PyExc_ValueError, "no encoding specified"); - return NULL; - } -#endif /* Encode via the codec registry */ return PyCodec_Encode(v, encoding, errors); @@ -127,15 +120,8 @@ codec_decode(PyObject *self, PyObject *args) if (!PyArg_ParseTuple(args, "O|ss:decode", &v, &encoding, &errors)) return NULL; -#ifdef Py_USING_UNICODE if (encoding == NULL) encoding = PyUnicode_GetDefaultEncoding(); -#else - if (encoding == NULL) { - PyErr_SetString(PyExc_ValueError, "no encoding specified"); - return NULL; - } -#endif /* Decode via the codec registry */ return PyCodec_Decode(v, encoding, errors); @@ -198,7 +184,6 @@ escape_encode(PyObject *self, return codec_tuple(str, PyString_Size(str)); } -#ifdef Py_USING_UNICODE /* --- Decoder ------------------------------------------------------------ */ static PyObject * @@ -833,7 +818,6 @@ mbcs_encode(PyObject *self, } #endif /* MS_WINDOWS */ -#endif /* Py_USING_UNICODE */ /* --- Error handler registry --------------------------------------------- */ @@ -888,7 +872,6 @@ static PyMethodDef _codecs_functions[] = { decode__doc__}, {"escape_encode", escape_encode, METH_VARARGS}, {"escape_decode", escape_decode, METH_VARARGS}, -#ifdef Py_USING_UNICODE {"utf_8_encode", utf_8_encode, METH_VARARGS}, {"utf_8_decode", utf_8_decode, METH_VARARGS}, {"utf_7_encode", utf_7_encode, METH_VARARGS}, @@ -919,7 +902,6 @@ static PyMethodDef _codecs_functions[] = { {"mbcs_encode", mbcs_encode, METH_VARARGS}, {"mbcs_decode", mbcs_decode, METH_VARARGS}, #endif -#endif /* Py_USING_UNICODE */ {"register_error", register_error, METH_VARARGS, register_error__doc__}, {"lookup_error", lookup_error, METH_VARARGS, |