diff options
author | Ezio Melotti <ezio.melotti@gmail.com> | 2011-11-17 10:23:34 (GMT) |
---|---|---|
committer | Ezio Melotti <ezio.melotti@gmail.com> | 2011-11-17 10:23:34 (GMT) |
commit | adc417ce361282927bb580830a9568810874a9bc (patch) | |
tree | 931b2ebed072febfdc1bcf2173bf594f87cfe889 /Modules/_codecsmodule.c | |
parent | 5a8bc6f7f9bd58a08032e3712dd321f254c864d8 (diff) | |
download | cpython-adc417ce361282927bb580830a9568810874a9bc.zip cpython-adc417ce361282927bb580830a9568810874a9bc.tar.gz cpython-adc417ce361282927bb580830a9568810874a9bc.tar.bz2 |
#13406: fix more deprecation warnings and move the deprecation of unicode-internal earlier in the code.
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 4cd5c23..7818f9a 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; |