Kaydet (Commit) 28e83e3a authored tarafından Guido van Rossum's avatar Guido van Rossum

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

üst b1ded1e5
......@@ -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;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment