aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/Modules
diff options
context:
space:
mode:
Diffstat (limited to 'Modules')
-rw-r--r--Modules/_asynciomodule.c2
-rw-r--r--Modules/_testbuffer.c3
-rw-r--r--Modules/_testcapi/monitoring.c2
-rw-r--r--Modules/_testcapi/time.c3
-rw-r--r--Modules/_testcapimodule.c3
-rw-r--r--Modules/_testinternalcapi.c3
6 files changed, 6 insertions, 10 deletions
diff --git a/Modules/_asynciomodule.c b/Modules/_asynciomodule.c
index 5f9181395c4..99408e60721 100644
--- a/Modules/_asynciomodule.c
+++ b/Modules/_asynciomodule.c
@@ -821,7 +821,7 @@ future_add_done_callback(asyncio_state *state, FutureObj *fut, PyObject *arg,
Invariants:
* callbacks != NULL:
- There are some callbacks in in the list. Just
+ There are some callbacks in the list. Just
add the new callback to it.
* callbacks == NULL and callback0 == NULL:
diff --git a/Modules/_testbuffer.c b/Modules/_testbuffer.c
index 7fc4d61db29..d2e61e9d6ac 100644
--- a/Modules/_testbuffer.c
+++ b/Modules/_testbuffer.c
@@ -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;
diff --git a/Modules/_testcapi/monitoring.c b/Modules/_testcapi/monitoring.c
index 08a2055c51b..e041943492d 100644
--- a/Modules/_testcapi/monitoring.c
+++ b/Modules/_testcapi/monitoring.c
@@ -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; \
}
diff --git a/Modules/_testcapi/time.c b/Modules/_testcapi/time.c
index 464cf5c3125..4ca6ff587b9 100644
--- a/Modules/_testcapi/time.c
+++ b/Modules/_testcapi/time.c
@@ -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;
}
diff --git a/Modules/_testcapimodule.c b/Modules/_testcapimodule.c
index 71fffedee14..334f2a53041 100644
--- a/Modules/_testcapimodule.c
+++ b/Modules/_testcapimodule.c
@@ -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;
}
diff --git a/Modules/_testinternalcapi.c b/Modules/_testinternalcapi.c
index 8027f0015c7..533e7dd3a7e 100644
--- a/Modules/_testinternalcapi.c
+++ b/Modules/_testinternalcapi.c
@@ -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 *