]> granicus.if.org Git - python/commitdiff
Issue #7330, #10833: Replace %100s by %.100s and %200s by %.200s
authorVictor Stinner <victor.stinner@haypocalc.com>
Tue, 22 Mar 2011 00:09:21 +0000 (01:09 +0100)
committerVictor Stinner <victor.stinner@haypocalc.com>
Tue, 22 Mar 2011 00:09:21 +0000 (01:09 +0100)
I suppose that the author would like to truncate the type name, not get a
string of 100/200 characters.

Objects/abstract.c
Python/ceval.c

index 2f887aa0563796bb9422f2c05b6697687508db4b..11e145f16865dc3d538c1cb476261c4509fb24c4 100644 (file)
@@ -331,7 +331,7 @@ PyObject_GetBuffer(PyObject *obj, Py_buffer *view, int flags)
 {
     if (!PyObject_CheckBuffer(obj)) {
         PyErr_Format(PyExc_TypeError,
-                     "'%100s' does not support the buffer interface",
+                     "'%.100s' does not support the buffer interface",
                      Py_TYPE(obj)->tp_name);
         return -1;
     }
index d2444aa9f0b60676668f30d5f145a9b5cb1b3dca..50d5aacd9e3aeea3972b7274ea0e298ab186c092 100644 (file)
@@ -4130,7 +4130,7 @@ ext_do_call(PyObject *func, PyObject ***pp_stack, int flags, int na, int nk)
                 if (PyErr_ExceptionMatches(PyExc_TypeError)) {
                     PyErr_Format(PyExc_TypeError,
                                  "%.200s%.200s argument after * "
-                                 "must be a sequence, not %200s",
+                                 "must be a sequence, not %.200s",
                                  PyEval_GetFuncName(func),
                                  PyEval_GetFuncDesc(func),
                                  stararg->ob_type->tp_name);