reachableroots: fix transposition of set and list types in PyArg_ParseTuple

This is being masked by the function not properly returning NULL when
it raises an exception, so the client code was just falling back to
the native codepath when it got None back. A future change removes all
reason for this C function to return None, which exposed this problem
during development.
This commit is contained in:
Augie Fackler 2015-08-11 15:34:10 -04:00
parent eebac428f3
commit 380097abbb

View File

@ -1112,8 +1112,10 @@ static PyObject *reachableroots(indexObject *self, PyObject *args)
long minroot;
PyObject *includepatharg = NULL;
int includepath = 0;
/* heads is a list */
PyObject *heads = NULL;
Py_ssize_t numheads;
/* roots is a set */
PyObject *roots = NULL;
PyObject *reachable = NULL;
@ -1134,8 +1136,8 @@ static PyObject *reachableroots(indexObject *self, PyObject *args)
char *seen = NULL;
/* Get arguments */
if (!PyArg_ParseTuple(args, "lO!O!O!", &minroot, &PySet_Type, &heads,
&PyList_Type, &roots, &PyBool_Type, &includepatharg))
if (!PyArg_ParseTuple(args, "lO!O!O!", &minroot, &PyList_Type, &heads,
&PySet_Type, &roots, &PyBool_Type, &includepatharg))
goto bail;
if (includepatharg == Py_True)