diff --git a/mercurial/parsers.c b/mercurial/parsers.c
--- a/mercurial/parsers.c
+++ b/mercurial/parsers.c
@@ -2516,8 +2516,7 @@ static PyGetSetDef index_getset[] = {
 };
 
 static PyTypeObject indexType = {
-	PyObject_HEAD_INIT(NULL)
-	0,                         /* ob_size */
+	PyVarObject_HEAD_INIT(NULL, 0)
 	"parsers.index",           /* tp_name */
 	sizeof(indexObject),       /* tp_basicsize */
 	0,                         /* tp_itemsize */