diff options
author | Guido van Rossum <guido@python.org> | 2003-04-14 18:25:04 (GMT) |
---|---|---|
committer | Guido van Rossum <guido@python.org> | 2003-04-14 18:25:04 (GMT) |
commit | 817d6c9c9e1d838885fa3422021f4c74cf639a8c (patch) | |
tree | d64019df16de261a319eb1ce19b204bb74618d1c /Python | |
parent | 41c99e7f96f7a0f192839801c568d8a80dcc7091 (diff) | |
download | cpython-817d6c9c9e1d838885fa3422021f4c74cf639a8c.zip cpython-817d6c9c9e1d838885fa3422021f4c74cf639a8c.tar.gz cpython-817d6c9c9e1d838885fa3422021f4c74cf639a8c.tar.bz2 |
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. :-)
Diffstat (limited to 'Python')
-rw-r--r-- | Python/bltinmodule.c | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/Python/bltinmodule.c b/Python/bltinmodule.c index c8b784a..aeb2d53 100644 --- a/Python/bltinmodule.c +++ b/Python/bltinmodule.c @@ -1366,24 +1366,24 @@ handle_range_longs(PyObject *self, PyObject *args) Py_INCREF(istep); } - /* 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."); + 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_SetString(PyExc_ValueError, - "integer end argument expected, got float."); + 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_SetString(PyExc_ValueError, - "integer step argument expected, got float."); + PyErr_Format(PyExc_ValueError, + "integer step argument expected, got %s.", + istep->ob_type->tp_name); goto Fail; } |