Fix type check in Diff_getitem

Fixes issue #495
This commit is contained in:
J. David Ibáñez 2015-02-20 17:14:22 +01:00
parent adb351f7b3
commit bc668751a4

@ -582,11 +582,10 @@ Diff_getitem(Diff *self, PyObject *value)
{
size_t i;
if (PyLong_Check(value) < 0)
if (!PyLong_Check(value))
return NULL;
i = PyLong_AsUnsignedLong(value);
return diff_get_patch_byindex(self->diff, i);
}