mirror of
https://github.com/python/cpython.git
synced 2025-08-03 16:39:00 +00:00
#13406: fix more deprecation warnings and move the deprecation of unicode-internal earlier in the code.
This commit is contained in:
parent
5a8bc6f7f9
commit
adc417ce36
3 changed files with 43 additions and 38 deletions
|
@ -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;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue