# HG changeset patch # User Augie Fackler # Date 2015-08-11 18:53:47 # Node ID 2c03e521a0c5defd1798bdbb0707d736db2e31fd # Parent bbb698697efc4ba9067e5db8a13b3c5e78632997 reachableroots: return NULL if we're throwing an exception Based on my reading of [0] and surrounding sections, if we want an exception to be properly raised when something goes wrong in the C code, we need to make sure we return NULL here. Do so. https://docs.python.org/2/extending/extending.html#back-to-the-example diff --git a/mercurial/parsers.c b/mercurial/parsers.c --- a/mercurial/parsers.c +++ b/mercurial/parsers.c @@ -1232,9 +1232,7 @@ release_seen_and_tovisit: release_reachable: Py_XDECREF(reachable); bail: - val = Py_None; - Py_INCREF(Py_None); - return val; + return NULL; } static PyObject *compute_phases_map_sets(indexObject *self, PyObject *args)