[Python-checkins] python/dist/src/Python bltinmodule.c,2.286,2.287
gvanrossum@users.sourceforge.net
gvanrossum@users.sourceforge.net
Mon, 14 Apr 2003 11:25:10 -0700
Update of /cvsroot/python/python/dist/src/Python
In directory sc8-pr-cvs1:/tmp/cvs-serv24329
Modified Files:
bltinmodule.c
Log Message:
Prompted by Tim's comment, when handle_range_longs() sees an
unexpected type, report the actual type rather than 'float'. (It's
hard to even reach this code with a float. :-)
Index: bltinmodule.c
===================================================================
RCS file: /cvsroot/python/python/dist/src/Python/bltinmodule.c,v
retrieving revision 2.286
retrieving revision 2.287
diff -C2 -d -r2.286 -r2.287
*** bltinmodule.c 13 Apr 2003 22:13:08 -0000 2.286
--- bltinmodule.c 14 Apr 2003 18:25:04 -0000 2.287
***************
*** 1367,1388 ****
}
- /* XXX What reason do we have to believe that if an arg isn't an
- * XXX int, it must be a float?
- */
if (!PyInt_Check(ilow) && !PyLong_Check(ilow)) {
! PyErr_SetString(PyExc_ValueError,
! "integer start argument expected, got float.");
goto Fail;
}
if (!PyInt_Check(ihigh) && !PyLong_Check(ihigh)) {
! PyErr_SetString(PyExc_ValueError,
! "integer end argument expected, got float.");
goto Fail;
}
if (!PyInt_Check(istep) && !PyLong_Check(istep)) {
! PyErr_SetString(PyExc_ValueError,
! "integer step argument expected, got float.");
goto Fail;
}
--- 1367,1388 ----
}
if (!PyInt_Check(ilow) && !PyLong_Check(ilow)) {
! PyErr_Format(PyExc_ValueError,
! "integer start argument expected, got %s.",
! ilow->ob_type->tp_name);
goto Fail;
}
if (!PyInt_Check(ihigh) && !PyLong_Check(ihigh)) {
! PyErr_Format(PyExc_ValueError,
! "integer end argument expected, got %s.",
! ihigh->ob_type->tp_name);
goto Fail;
}
if (!PyInt_Check(istep) && !PyLong_Check(istep)) {
! PyErr_Format(PyExc_ValueError,
! "integer step argument expected, got %s.",
! istep->ob_type->tp_name);
goto Fail;
}