summaryrefslogtreecommitdiff
path: root/Modules/_codecsmodule.c
diff options
context:
space:
mode:
authorEzio Melotti <ezio.melotti@gmail.com>2011-11-17 12:23:34 +0200
committerEzio Melotti <ezio.melotti@gmail.com>2011-11-17 12:23:34 +0200
commitadc417ce361282927bb580830a9568810874a9bc (patch)
tree931b2ebed072febfdc1bcf2173bf594f87cfe889 /Modules/_codecsmodule.c
parent5a8bc6f7f9bd58a08032e3712dd321f254c864d8 (diff)
downloadcpython-git-adc417ce361282927bb580830a9568810874a9bc.tar.gz
#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.c10
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;