[issue2440] Issues with getargs_n() and PyNumber_Index.

Trent Nelson report at bugs.python.org
Fri Apr 11 00:06:37 CEST 2008


Trent Nelson <tnelson at onresolve.com> added the comment:

Eek, so it does, thanks.  Applied the following patch on a bunch of 32-
bit/x64 systems, testing now, so far everything looks good...

Index: abstract.c
===================================================================
--- abstract.c  (revision 62279)
+++ abstract.c  (working copy)
@@ -1240,7 +1240,7 @@
                        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,

__________________________________
Tracker <report at bugs.python.org>
<http://bugs.python.org/issue2440>
__________________________________


More information about the Python-bugs-list mailing list