diff options
author | Trent Nelson <trent.nelson@snakebite.org> | 2008-04-10 22:21:23 +0000 |
---|---|---|
committer | Trent Nelson <trent.nelson@snakebite.org> | 2008-04-10 22:21:23 +0000 |
commit | 62d3f2647c173f50bf62ecfd84ca15187c3f586b (patch) | |
tree | 86635d869efa17bc9926018b8b8c4f2503786de1 | |
parent | 9f5bd1bf4c71ee4e73f2a57b44219ef0cf07f67b (diff) | |
download | cpython-62d3f2647c173f50bf62ecfd84ca15187c3f586b.tar.gz |
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.
-rw-r--r-- | Objects/abstract.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/Objects/abstract.c b/Objects/abstract.c index 6335aa2cae..684b0b4abd 100644 --- a/Objects/abstract.c +++ b/Objects/abstract.c @@ -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, |