summaryrefslogtreecommitdiffstats
path: root/Modules/cjkcodecs
diff options
context:
space:
mode:
authorVictor Stinner <vstinner@python.org>2023-06-01 23:33:17 (GMT)
committerGitHub <noreply@github.com>2023-06-01 23:33:17 (GMT)
commitef300937c2a1b3ebe19c2835f3b46585825c1e1f (patch)
tree34f151a390fb946ff985ed98e6c1bd096c4d090b /Modules/cjkcodecs
parentcbb9ba844f15f2b8127028e6dfd4681b2cb2376f (diff)
downloadcpython-ef300937c2a1b3ebe19c2835f3b46585825c1e1f.zip
cpython-ef300937c2a1b3ebe19c2835f3b46585825c1e1f.tar.gz
cpython-ef300937c2a1b3ebe19c2835f3b46585825c1e1f.tar.bz2
gh-92536: Remove PyUnicode_READY() calls (#105210)
Since Python 3.12, PyUnicode_READY() does nothing and always returns 0.
Diffstat (limited to 'Modules/cjkcodecs')
-rw-r--r--Modules/cjkcodecs/multibytecodec.c8
1 files changed, 0 insertions, 8 deletions
diff --git a/Modules/cjkcodecs/multibytecodec.c b/Modules/cjkcodecs/multibytecodec.c
index b501e4f..2b98bb5 100644
--- a/Modules/cjkcodecs/multibytecodec.c
+++ b/Modules/cjkcodecs/multibytecodec.c
@@ -490,8 +490,6 @@ multibytecodec_encode(const MultibyteCodec *codec,
int kind;
const void *data;
- if (PyUnicode_READY(text) < 0)
- return NULL;
datalen = PyUnicode_GET_LENGTH(text);
if (datalen == 0 && !(flags & MBENC_RESET))
@@ -603,10 +601,6 @@ _multibytecodec_MultibyteCodec_encode_impl(MultibyteCodecObject *self,
}
}
- if (PyUnicode_READY(input) < 0) {
- Py_XDECREF(ucvt);
- return NULL;
- }
datalen = PyUnicode_GET_LENGTH(input);
errorcb = internal_error_callback(errors);
@@ -809,8 +803,6 @@ encoder_encode_stateful(MultibyteStatefulEncoderContext *ctx,
inbuf = Py_NewRef(unistr);
}
- if (PyUnicode_READY(inbuf) < 0)
- goto errorexit;
inpos = 0;
datalen = PyUnicode_GET_LENGTH(inbuf);