mirror of
https://github.com/python/cpython.git
synced 2025-07-24 11:44:31 +00:00
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:
parent
7fedbe513d
commit
d12fbe9ef7
1 changed files with 1 additions and 1 deletions
|
@ -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,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue