Kaydet (Commit) 9bcd1d79 authored tarafından Guido van Rossum's avatar Guido van Rossum

Improve text of some error messages, as suggested by Sean Reifschneider.

üst 0cf46bc0
...@@ -707,7 +707,7 @@ docompare(x, y, compare) ...@@ -707,7 +707,7 @@ docompare(x, y, compare)
if (!PyInt_Check(res)) { if (!PyInt_Check(res)) {
Py_DECREF(res); Py_DECREF(res);
PyErr_SetString(PyExc_TypeError, PyErr_SetString(PyExc_TypeError,
"comparison function should return int"); "comparison function must return int");
return CMPERROR; return CMPERROR;
} }
i = PyInt_AsLong(res); i = PyInt_AsLong(res);
...@@ -1340,7 +1340,8 @@ listcount(self, args) ...@@ -1340,7 +1340,8 @@ listcount(self, args)
int i; int i;
if (args == NULL) { if (args == NULL) {
PyErr_BadArgument(); PyErr_SetString(PyExc_TypeError,
"list.count(x): argument missing");
return NULL; return NULL;
} }
for (i = 0; i < self->ob_size; i++) { for (i = 0; i < self->ob_size; i++) {
......
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