diff options
Diffstat (limited to 'Modules/_codecsmodule.c')
-rw-r--r-- | Modules/_codecsmodule.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/Modules/_codecsmodule.c b/Modules/_codecsmodule.c index 4cd5c23fec..7818f9a42f 100644 --- a/Modules/_codecsmodule.c +++ b/Modules/_codecsmodule.c @@ -677,6 +677,11 @@ unicode_internal_encode(PyObject *self, const char *data; Py_ssize_t len, size; + if (PyErr_WarnEx(PyExc_DeprecationWarning, + "unicode_internal codec has been deprecated", + 1)) + return NULL; + if (!PyArg_ParseTuple(args, "O|z:unicode_internal_encode", &obj, &errors)) return NULL; @@ -687,11 +692,6 @@ unicode_internal_encode(PyObject *self, if (PyUnicode_READY(obj) < 0) return NULL; - if (PyErr_WarnEx(PyExc_DeprecationWarning, - "unicode_internal codec has been deprecated", - 1)) - return NULL; - u = PyUnicode_AsUnicodeAndSize(obj, &len); if (u == NULL) return NULL; |