# HG changeset patch # User Bob Ippolito <bob@redivi.com> # Date 1400642732 25200 # Tue May 20 20:25:32 2014 -0700 # Node ID 6a3e1e8ea57d38b9a0b3f012ca21dd14467426d4 # Parent 80c12cb773a26e1866dbe73e9545b1d52ab3b913 fix arg check for item_sort_key diff --git a/simplejson/_speedups.c b/simplejson/_speedups.c --- a/simplejson/_speedups.c +++ b/simplejson/_speedups.c @@ -2616,8 +2616,10 @@ s->tuple_as_array = PyObject_IsTrue(tuple_as_array); s->bigint_as_string = PyObject_IsTrue(bigint_as_string); if (item_sort_key != Py_None) { - if (!PyCallable_Check(item_sort_key)) + if (!PyCallable_Check(item_sort_key)) { PyErr_SetString(PyExc_TypeError, "item_sort_key must be None or callable"); + return -1; + } } else if (PyObject_IsTrue(sort_keys)) { static PyObject *itemgetter0 = NULL;