Some errors from range() should be TypeError, not ValueError.

This commit is contained in:
Guido van Rossum 2003-04-15 12:43:26 +00:00
parent b1ded1e508
commit 28e83e3a66
1 changed files with 3 additions and 3 deletions

View File

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