]> granicus.if.org Git - python/commitdiff
Fix change to PyNumber_Index() made in r62269, which incorrectly allowed floats to...
authorTrent Nelson <trent.nelson@snakebite.org>
Thu, 10 Apr 2008 22:21:23 +0000 (22:21 +0000)
committerTrent Nelson <trent.nelson@snakebite.org>
Thu, 10 Apr 2008 22:21:23 +0000 (22:21 +0000)
Objects/abstract.c

index 6335aa2cae9c25da7d4c226a4424b8e717ddb255..684b0b4abd273af610c56212c632955f34dacbe8 100644 (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,