]> granicus.if.org Git - python/commitdiff
Some errors from range() should be TypeError, not ValueError.
authorGuido van Rossum <guido@python.org>
Tue, 15 Apr 2003 12:43:26 +0000 (12:43 +0000)
committerGuido van Rossum <guido@python.org>
Tue, 15 Apr 2003 12:43:26 +0000 (12:43 +0000)
Python/bltinmodule.c

index aeb2d53b5d0f60c78de4b0d1f523cc66d64ae1c9..adefba28f1d705d0bcb02737a092ebb374c38ca3 100644 (file)
@@ -1367,21 +1367,21 @@ handle_range_longs(PyObject *self, PyObject *args)
        }
 
        if (!PyInt_Check(ilow) && !PyLong_Check(ilow)) {
-               PyErr_Format(PyExc_ValueError,
+               PyErr_Format(PyExc_TypeError,
                             "integer start argument expected, got %s.",
                             ilow->ob_type->tp_name);
                goto Fail;
        }
 
        if (!PyInt_Check(ihigh) && !PyLong_Check(ihigh)) {
-               PyErr_Format(PyExc_ValueError,
+               PyErr_Format(PyExc_TypeError,
                             "integer end argument expected, got %s.",
                             ihigh->ob_type->tp_name);
                goto Fail;
        }
 
        if (!PyInt_Check(istep) && !PyLong_Check(istep)) {
-               PyErr_Format(PyExc_ValueError,
+               PyErr_Format(PyExc_TypeError,
                             "integer step argument expected, got %s.",
                             istep->ob_type->tp_name);
                goto Fail;