summaryrefslogtreecommitdiffstats
path: root/Modules/gdbmmodule.c
diff options
context:
space:
mode:
Diffstat (limited to 'Modules/gdbmmodule.c')
-rw-r--r--Modules/gdbmmodule.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/Modules/gdbmmodule.c b/Modules/gdbmmodule.c
index f3fee4d..52659e1 100644
--- a/Modules/gdbmmodule.c
+++ b/Modules/gdbmmodule.c
@@ -36,7 +36,7 @@ typedef struct {
static PyTypeObject Dbmtype;
-#define is_dbmobject(v) ((v)->ob_type == &Dbmtype)
+#define is_dbmobject(v) (Py_Type(v) == &Dbmtype)
#define check_dbmobject_open(v) if ((v)->di_dbm == NULL) \
{ PyErr_SetString(DbmError, "GDBM object has already been closed"); \
return NULL; }
@@ -393,8 +393,7 @@ dbm_getattr(dbmobject *dp, char *name)
}
static PyTypeObject Dbmtype = {
- PyObject_HEAD_INIT(0)
- 0,
+ PyVarObject_HEAD_INIT(0, 0)
"gdbm.gdbm",
sizeof(dbmobject),
0,