parsers: handle refcounting of "parents" consistently
Py_None can be refcounted like any other Python object. So
do that.
--- a/mercurial/parsers.c Wed Mar 15 09:32:18 2017 -0700
+++ b/mercurial/parsers.c Mon Mar 13 17:49:13 2017 -0700
@@ -2739,6 +2739,7 @@
data += nparents * hashwidth;
} else {
parents = Py_None;
+ Py_INCREF(parents);
}
if (data + 2 * nmetadata > dataend) {
@@ -2781,8 +2782,7 @@
Py_XDECREF(prec);
Py_XDECREF(succs);
Py_XDECREF(metadata);
- if (parents != Py_None)
- Py_XDECREF(parents);
+ Py_XDECREF(parents);
return ret;
}