diff options
Diffstat (limited to 'Modules/cjkcodecs/multibytecodec.c')
-rw-r--r-- | Modules/cjkcodecs/multibytecodec.c | 23 |
1 files changed, 9 insertions, 14 deletions
diff --git a/Modules/cjkcodecs/multibytecodec.c b/Modules/cjkcodecs/multibytecodec.c index 933aa1b..7d14437 100644 --- a/Modules/cjkcodecs/multibytecodec.c +++ b/Modules/cjkcodecs/multibytecodec.c @@ -676,8 +676,7 @@ multibytecodec_dealloc(MultibyteCodecObject *self) } static PyTypeObject MultibyteCodec_Type = { - PyObject_HEAD_INIT(NULL) - 0, /* ob_size */ + PyVarObject_HEAD_INIT(NULL, 0) "MultibyteCodec", /* tp_name */ sizeof(MultibyteCodecObject), /* tp_basicsize */ 0, /* tp_itemsize */ @@ -952,12 +951,11 @@ mbiencoder_dealloc(MultibyteIncrementalEncoderObject *self) { PyObject_GC_UnTrack(self); ERROR_DECREF(self->errors); - self->ob_type->tp_free(self); + Py_Type(self)->tp_free(self); } static PyTypeObject MultibyteIncrementalEncoder_Type = { - PyObject_HEAD_INIT(NULL) - 0, /* ob_size */ + PyVarObject_HEAD_INIT(NULL, 0) "MultibyteIncrementalEncoder", /* tp_name */ sizeof(MultibyteIncrementalEncoderObject), /* tp_basicsize */ 0, /* tp_itemsize */ @@ -1153,12 +1151,11 @@ mbidecoder_dealloc(MultibyteIncrementalDecoderObject *self) { PyObject_GC_UnTrack(self); ERROR_DECREF(self->errors); - self->ob_type->tp_free(self); + Py_Type(self)->tp_free(self); } static PyTypeObject MultibyteIncrementalDecoder_Type = { - PyObject_HEAD_INIT(NULL) - 0, /* ob_size */ + PyVarObject_HEAD_INIT(NULL, 0) "MultibyteIncrementalDecoder", /* tp_name */ sizeof(MultibyteIncrementalDecoderObject), /* tp_basicsize */ 0, /* tp_itemsize */ @@ -1488,12 +1485,11 @@ mbstreamreader_dealloc(MultibyteStreamReaderObject *self) PyObject_GC_UnTrack(self); ERROR_DECREF(self->errors); Py_DECREF(self->stream); - self->ob_type->tp_free(self); + Py_Type(self)->tp_free(self); } static PyTypeObject MultibyteStreamReader_Type = { - PyObject_HEAD_INIT(NULL) - 0, /* ob_size */ + PyVarObject_HEAD_INIT(NULL, 0) "MultibyteStreamReader", /* tp_name */ sizeof(MultibyteStreamReaderObject), /* tp_basicsize */ 0, /* tp_itemsize */ @@ -1692,7 +1688,7 @@ mbstreamwriter_dealloc(MultibyteStreamWriterObject *self) PyObject_GC_UnTrack(self); ERROR_DECREF(self->errors); Py_DECREF(self->stream); - self->ob_type->tp_free(self); + Py_Type(self)->tp_free(self); } static struct PyMethodDef mbstreamwriter_methods[] = { @@ -1713,8 +1709,7 @@ static PyMemberDef mbstreamwriter_members[] = { }; static PyTypeObject MultibyteStreamWriter_Type = { - PyObject_HEAD_INIT(NULL) - 0, /* ob_size */ + PyVarObject_HEAD_INIT(NULL, 0) "MultibyteStreamWriter", /* tp_name */ sizeof(MultibyteStreamWriterObject), /* tp_basicsize */ 0, /* tp_itemsize */ |