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

View File

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