Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
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
3 changes: 1 addition & 2 deletions Modules/_testbuffer.c
Original file line number Diff line number Diff line change
Expand Up @@ -1855,8 +1855,7 @@ ndarray_subscript(PyObject *op, PyObject *key)

type_error:
PyErr_Format(PyExc_TypeError,
"cannot index memory using \"%.200s\"",
Py_TYPE(key)->tp_name);
"cannot index memory using \"%T\"", key);
err_occurred:
Py_DECREF(nd);
return NULL;
Expand Down
2 changes: 1 addition & 1 deletion Modules/_testcapi/monitoring.c
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ static PyTypeObject PyCodeLike_Type = {
};

#define RAISE_UNLESS_CODELIKE(v) if (!Py_IS_TYPE((v), &PyCodeLike_Type)) { \
PyErr_Format(PyExc_TypeError, "expected a code-like, got %s", Py_TYPE(v)->tp_name); \
PyErr_Format(PyExc_TypeError, "expected a code-like, got %T", v); \
return NULL; \
}

Expand Down
3 changes: 1 addition & 2 deletions Modules/_testcapi/time.c
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,7 @@ static int
pytime_from_nanoseconds(PyTime_t *tp, PyObject *obj)
{
if (!PyLong_Check(obj)) {
PyErr_Format(PyExc_TypeError, "expect int, got %s",
Py_TYPE(obj)->tp_name);
PyErr_Format(PyExc_TypeError, "expect int, got %T", obj);
return -1;
}

Expand Down
3 changes: 1 addition & 2 deletions Modules/_testcapimodule.c
Original file line number Diff line number Diff line change
Expand Up @@ -515,8 +515,7 @@ test_thread_state(PyObject *self, PyObject *args)
return NULL;

if (!PyCallable_Check(fn)) {
PyErr_Format(PyExc_TypeError, "'%s' object is not callable",
Py_TYPE(fn)->tp_name);
PyErr_Format(PyExc_TypeError, "'%T' object is not callable", fn);
return NULL;
}

Expand Down
3 changes: 1 addition & 2 deletions Modules/_testinternalcapi.c
Original file line number Diff line number Diff line change
Expand Up @@ -2207,8 +2207,7 @@ get_code(PyObject *obj)
return (PyCodeObject *)PyFunction_GetCode(obj);
}
return (PyCodeObject *)PyErr_Format(
PyExc_TypeError, "expected function or code object, got %s",
Py_TYPE(obj)->tp_name);
PyExc_TypeError, "expected function or code object, got %T", obj);
}

static PyObject *
Expand Down
Loading