Kaydet (Commit) d12fbe9e authored tarafından Trent Nelson's avatar Trent Nelson

Fix change to PyNumber_Index() made in r62269, which incorrectly allowed floats…

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.
üst 7fedbe51
...@@ -1240,7 +1240,7 @@ PyNumber_Index(PyObject *item) ...@@ -1240,7 +1240,7 @@ PyNumber_Index(PyObject *item)
return NULL; 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); result = m->nb_int(item);
if (result && !PyLong_Check(result)) { if (result && !PyLong_Check(result)) {
PyErr_Format(PyExc_TypeError, PyErr_Format(PyExc_TypeError,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment