Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions Objects/abstract.c
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ PyObject_LengthHint(PyObject *o, Py_ssize_t defaultvalue)
}
if (res < 0) {
PyErr_Format(PyExc_ValueError,
"%T.__length_hint__() must return a positive int", o);
"%T.__length_hint__() must return a non-negative int", o);
return -1;
}
return res;
Expand Down Expand Up @@ -2817,7 +2817,7 @@ PyObject_GetIter(PyObject *o)
PyObject *res = (*f)(o);
if (res != NULL && !PyIter_Check(res)) {
PyErr_Format(PyExc_TypeError,
"%T.iter() must return an iterator, not %T",
"%T.__iter__() must return an iterator, not %T",
o, res);
Py_SETREF(res, NULL);
}
Expand All @@ -2837,7 +2837,7 @@ PyObject_GetAIter(PyObject *o) {
PyObject *it = (*f)(o);
if (it != NULL && !PyAIter_Check(it)) {
PyErr_Format(PyExc_TypeError,
"%T.aiter() must return an async iterator, not %T",
"%T.__aiter__() must return an async iterator, not %T",
o, it);
Py_SETREF(it, NULL);
}
Expand Down
7 changes: 3 additions & 4 deletions Objects/typeobject.c
Original file line number Diff line number Diff line change
Expand Up @@ -3508,17 +3508,16 @@ mro_check(PyTypeObject *type, PyObject *mro)
PyObject *obj = PyTuple_GET_ITEM(mro, i);
if (!PyType_Check(obj)) {
PyErr_Format(PyExc_TypeError,
"%s.mro() returned a non-class ('%T')",
type->tp_name, obj);
"%N.mro() returned a non-class ('%T')", type, obj);
return -1;
}
PyTypeObject *base = (PyTypeObject*)obj;

if (!is_subtype_with_mro(lookup_tp_mro(solid), solid, solid_base(base))) {
PyErr_Format(
PyExc_TypeError,
"%s.mro() returned base with unsuitable layout ('%.500s')",
type->tp_name, base->tp_name);
"%N.mro() returned base with unsuitable layout ('%.500s')",
type, base->tp_name);
return -1;
}
}
Expand Down
Loading