Fix change to PyNumber_Index() made in r62269, which incorrectly allowed floats to be interpreted as longs. Thanks to Benjamin Peterson for picking this up.

This commit is contained in:
Trent Nelson 2008-04-10 22:21:23 +00:00
parent 7fedbe513d
commit d12fbe9ef7

View File

@ -1240,7 +1240,7 @@ PyNumber_Index(PyObject *item)
return NULL;
}
}
else if (m && m->nb_int != NULL) {
else if (m && m->nb_int != NULL && m->nb_float == NULL) {
result = m->nb_int(item);
if (result && !PyLong_Check(result)) {
PyErr_Format(PyExc_TypeError,