summaryrefslogtreecommitdiffstats
path: root/Modules/cjkcodecs/multibytecodec.c
diff options
context:
space:
mode:
Diffstat (limited to 'Modules/cjkcodecs/multibytecodec.c')
-rw-r--r--Modules/cjkcodecs/multibytecodec.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/Modules/cjkcodecs/multibytecodec.c b/Modules/cjkcodecs/multibytecodec.c
index c6b3492..1735dfd 100644
--- a/Modules/cjkcodecs/multibytecodec.c
+++ b/Modules/cjkcodecs/multibytecodec.c
@@ -1793,12 +1793,12 @@ __create_codec(PyObject *ignore, PyObject *arg)
MultibyteCodecObject *self;
MultibyteCodec *codec;
- if (!PyCObject_Check(arg)) {
+ if (!PyCapsule_IsValid(arg, PyMultibyteCodec_CAPSULE_NAME)) {
PyErr_SetString(PyExc_ValueError, "argument type invalid");
return NULL;
}
- codec = PyCObject_AsVoidPtr(arg);
+ codec = PyCapsule_GetPointer(arg, PyMultibyteCodec_CAPSULE_NAME);
if (codec->codecinit != NULL && codec->codecinit(codec->config) != 0)
return NULL;