Mercurial > cpython-lru_cache-weakref
diff Python/bltinmodule.c @ 28738:52f3d90c17e8 legacy-trunk
complete and clarify some error messages for range()
| author | Alex Martelli <aleaxit@gmail.com> |
|---|---|
| date | Wed, 23 Apr 2003 13:00:44 +0000 |
| parents | 16ef5b9bc789 |
| children | d3297e298211 |
line wrap: on
line diff
--- a/Python/bltinmodule.c Wed Apr 23 12:07:22 2003 +0000 +++ b/Python/bltinmodule.c Wed Apr 23 13:00:44 2003 +0000 @@ -1368,21 +1368,21 @@ if (!PyInt_Check(ilow) && !PyLong_Check(ilow)) { PyErr_Format(PyExc_TypeError, - "integer start argument expected, got %s.", + "range() integer start argument expected, got %s.", ilow->ob_type->tp_name); goto Fail; } if (!PyInt_Check(ihigh) && !PyLong_Check(ihigh)) { PyErr_Format(PyExc_TypeError, - "integer end argument expected, got %s.", + "range() integer end argument expected, got %s.", ihigh->ob_type->tp_name); goto Fail; } if (!PyInt_Check(istep) && !PyLong_Check(istep)) { PyErr_Format(PyExc_TypeError, - "integer step argument expected, got %s.", + "range() integer step argument expected, got %s.", istep->ob_type->tp_name); goto Fail; } @@ -1391,7 +1391,7 @@ goto Fail; if (cmp_result == 0) { PyErr_SetString(PyExc_ValueError, - "range() arg 3 must not be zero"); + "range() step argument must not be zero"); goto Fail; } @@ -1507,7 +1507,7 @@ } if (istep == 0) { PyErr_SetString(PyExc_ValueError, - "range() arg 3 must not be zero"); + "range() step argument must not be zero"); return NULL; } if (istep > 0)
