@@ -78,8 +78,8 @@ descr_check(PyDescrObject *descr, PyObject *obj, PyObject **pres)
7878 }
7979 if (!PyObject_TypeCheck (obj , descr -> d_type )) {
8080 PyErr_Format (PyExc_TypeError ,
81- "descriptor '%V' for '%s ' objects "
82- "doesn't apply to '%s ' object" ,
81+ "descriptor '%V' for '%.100s ' objects "
82+ "doesn't apply to a '%.100s ' object" ,
8383 descr_name ((PyDescrObject * )descr ), "?" ,
8484 descr -> d_type -> tp_name ,
8585 obj -> ob_type -> tp_name );
@@ -99,7 +99,7 @@ classmethod_get(PyMethodDescrObject *descr, PyObject *obj, PyObject *type)
9999 else {
100100 /* Wot - no type?! */
101101 PyErr_Format (PyExc_TypeError ,
102- "descriptor '%V' for type '%s ' "
102+ "descriptor '%V' for type '%.100s ' "
103103 "needs either an object or a type" ,
104104 descr_name ((PyDescrObject * )descr ), "?" ,
105105 PyDescr_TYPE (descr )-> tp_name );
@@ -108,17 +108,17 @@ classmethod_get(PyMethodDescrObject *descr, PyObject *obj, PyObject *type)
108108 }
109109 if (!PyType_Check (type )) {
110110 PyErr_Format (PyExc_TypeError ,
111- "descriptor '%V' for type '%s ' "
112- "needs a type, not a '%s ' as arg 2" ,
111+ "descriptor '%V' for type '%.100s ' "
112+ "needs a type, not a '%.100s ' as arg 2" ,
113113 descr_name ((PyDescrObject * )descr ), "?" ,
114114 PyDescr_TYPE (descr )-> tp_name ,
115115 type -> ob_type -> tp_name );
116116 return NULL ;
117117 }
118118 if (!PyType_IsSubtype ((PyTypeObject * )type , PyDescr_TYPE (descr ))) {
119119 PyErr_Format (PyExc_TypeError ,
120- "descriptor '%V' for type '%s ' "
121- "doesn't apply to type '%s '" ,
120+ "descriptor '%V' requires a subtype of '%.100s ' "
121+ "but received '%.100s '" ,
122122 descr_name ((PyDescrObject * )descr ), "?" ,
123123 PyDescr_TYPE (descr )-> tp_name ,
124124 ((PyTypeObject * )type )-> tp_name );
@@ -181,7 +181,7 @@ descr_setcheck(PyDescrObject *descr, PyObject *obj, PyObject *value,
181181 if (!PyObject_TypeCheck (obj , descr -> d_type )) {
182182 PyErr_Format (PyExc_TypeError ,
183183 "descriptor '%V' for '%.100s' objects "
184- "doesn't apply to '%.100s' object" ,
184+ "doesn't apply to a '%.100s' object" ,
185185 descr_name (descr ), "?" ,
186186 descr -> d_type -> tp_name ,
187187 obj -> ob_type -> tp_name );
@@ -239,9 +239,8 @@ methoddescr_call(PyMethodDescrObject *descr, PyObject *args, PyObject *kwargs)
239239 if (!_PyObject_RealIsSubclass ((PyObject * )Py_TYPE (self ),
240240 (PyObject * )PyDescr_TYPE (descr ))) {
241241 PyErr_Format (PyExc_TypeError ,
242- "descriptor '%V' "
243- "requires a '%.100s' object "
244- "but received a '%.100s'" ,
242+ "descriptor '%V' for '%.100s' objects "
243+ "doesn't apply to a '%.100s' object" ,
245244 descr_name ((PyDescrObject * )descr ), "?" ,
246245 PyDescr_TYPE (descr )-> tp_name ,
247246 self -> ob_type -> tp_name );
@@ -278,9 +277,8 @@ _PyMethodDescr_FastCallKeywords(PyObject *descrobj,
278277 if (!_PyObject_RealIsSubclass ((PyObject * )Py_TYPE (self ),
279278 (PyObject * )PyDescr_TYPE (descr ))) {
280279 PyErr_Format (PyExc_TypeError ,
281- "descriptor '%V' "
282- "requires a '%.100s' object "
283- "but received a '%.100s'" ,
280+ "descriptor '%V' for '%.100s' objects "
281+ "doesn't apply to a '%.100s' object" ,
284282 descr_name ((PyDescrObject * )descr ), "?" ,
285283 PyDescr_TYPE (descr )-> tp_name ,
286284 self -> ob_type -> tp_name );
0 commit comments