summaryrefslogtreecommitdiffstats
path: root/Objects/abstract.c
diff options
context:
space:
mode:
authorTrent Nelson <trent.nelson@snakebite.org>2008-04-10 22:21:23 (GMT)
committerTrent Nelson <trent.nelson@snakebite.org>2008-04-10 22:21:23 (GMT)
commitd12fbe9ef788d349fbd42e1b4d054975b829ccbf (patch)
treefa64cd7d4d16069152b072a0a2243ffb03cab802 /Objects/abstract.c
parent7fedbe513d5ccc735d36e1da9781fcab1ca5961e (diff)
downloadcpython-d12fbe9ef788d349fbd42e1b4d054975b829ccbf.zip
cpython-d12fbe9ef788d349fbd42e1b4d054975b829ccbf.tar.gz
cpython-d12fbe9ef788d349fbd42e1b4d054975b829ccbf.tar.bz2
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.
Diffstat (limited to 'Objects/abstract.c')
-rw-r--r--Objects/abstract.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/Objects/abstract.c b/Objects/abstract.c
index 6335aa2..684b0b4 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,