comparison mercurial/parsers.c @ 26010:2c03e521a0c5

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
author Augie Fackler <augie@google.com>
date Tue, 11 Aug 2015 14:53:47 -0400
parents bbb698697efc
children ed60d2ae1935
comparison
equal deleted inserted replaced
26009:bbb698697efc 26010:2c03e521a0c5
1230 free(tovisit); 1230 free(tovisit);
1231 return reachable; 1231 return reachable;
1232 release_reachable: 1232 release_reachable:
1233 Py_XDECREF(reachable); 1233 Py_XDECREF(reachable);
1234 bail: 1234 bail:
1235 val = Py_None; 1235 return NULL;
1236 Py_INCREF(Py_None);
1237 return val;
1238 } 1236 }
1239 1237
1240 static PyObject *compute_phases_map_sets(indexObject *self, PyObject *args) 1238 static PyObject *compute_phases_map_sets(indexObject *self, PyObject *args)
1241 { 1239 {
1242 PyObject *roots = Py_None; 1240 PyObject *roots = Py_None;