diff options
Diffstat (limited to 'Modules/_csv.c')
-rw-r--r-- | Modules/_csv.c | 13 |
1 files changed, 5 insertions, 8 deletions
diff --git a/Modules/_csv.c b/Modules/_csv.c index e3dca2c..246cc6c 100644 --- a/Modules/_csv.c +++ b/Modules/_csv.c @@ -125,7 +125,7 @@ typedef struct { static PyTypeObject Reader_Type; -#define ReaderObject_Check(v) ((v)->ob_type == &Reader_Type) +#define ReaderObject_Check(v) (Py_Type(v) == &Reader_Type) typedef struct { PyObject_HEAD @@ -310,7 +310,7 @@ static void Dialect_dealloc(DialectObj *self) { Py_XDECREF(self->lineterminator); - self->ob_type->tp_free((PyObject *)self); + Py_Type(self)->tp_free((PyObject *)self); } static char *dialect_kws[] = { @@ -460,8 +460,7 @@ PyDoc_STRVAR(Dialect_Type_doc, "The Dialect type records CSV parsing and generation options.\n"); static PyTypeObject Dialect_Type = { - PyObject_HEAD_INIT(NULL) - 0, /* ob_size */ + PyVarObject_HEAD_INIT(NULL, 0) "_csv.Dialect", /* tp_name */ sizeof(DialectObj), /* tp_basicsize */ 0, /* tp_itemsize */ @@ -869,8 +868,7 @@ static struct PyMemberDef Reader_memberlist[] = { static PyTypeObject Reader_Type = { - PyObject_HEAD_INIT(NULL) - 0, /*ob_size*/ + PyVarObject_HEAD_INIT(NULL, 0) "_csv.reader", /*tp_name*/ sizeof(ReaderObj), /*tp_basicsize*/ 0, /*tp_itemsize*/ @@ -1280,8 +1278,7 @@ PyDoc_STRVAR(Writer_Type_doc, ); static PyTypeObject Writer_Type = { - PyObject_HEAD_INIT(NULL) - 0, /*ob_size*/ + PyVarObject_HEAD_INIT(NULL, 0) "_csv.writer", /*tp_name*/ sizeof(WriterObj), /*tp_basicsize*/ 0, /*tp_itemsize*/ |