From adc417ce361282927bb580830a9568810874a9bc Mon Sep 17 00:00:00 2001 From: Ezio Melotti Date: Thu, 17 Nov 2011 12:23:34 +0200 Subject: #13406: fix more deprecation warnings and move the deprecation of unicode-internal earlier in the code. --- Modules/_codecsmodule.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'Modules/_codecsmodule.c') 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; -- cgit v1.2.1