#13406: fix more deprecation warnings and move the deprecation of unicode-internal earlier in the code.

This commit is contained in:
Ezio Melotti 2011-11-17 12:23:34 +02:00
parent 5a8bc6f7f9
commit adc417ce36
3 changed files with 43 additions and 38 deletions

View file

@ -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;