static PyObject* __Pyx_Intern(PyObject* s) {
if (!(likely(PyString_CheckExact(s)))) {
- PyErr_Format(PyExc_TypeError, "Expected str, got %s", Py_TYPE(s)->tp_name);
+ PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "str", Py_TYPE(s)->tp_name);
return 0;
}
Py_INCREF(s);
PyObject *value = NULL;
if (!PyMapping_Check(o)) {
- PyErr_Format(PyExc_TypeError, "Expected a mapping, not %s", o->ob_type->tp_name);
+ PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "a mapping", Py_TYPE(o)->tp_name);
goto bad;
}
>>> test_obj_to_struct(None)
Traceback (most recent call last):
...
- TypeError: Expected a mapping, not NoneType
+ TypeError: Expected a mapping, got NoneType
>>> test_obj_to_struct(dict(s=b"world"))
Traceback (most recent call last):
...