[Python-checkins] cpython: Issue #7330, #10833: Replace %100s by %.100s and %200s by %.200s
victor.stinner
python-checkins at python.org
Tue Mar 22 01:10:07 CET 2011
http://hg.python.org/cpython/rev/d3ae3fe3eb97
changeset: 68822:d3ae3fe3eb97
user: Victor Stinner <victor.stinner at haypocalc.com>
date: Tue Mar 22 01:09:21 2011 +0100
summary:
Issue #7330, #10833: Replace %100s by %.100s and %200s by %.200s
I suppose that the author would like to truncate the type name, not get a
string of 100/200 characters.
files:
Objects/abstract.c
Python/ceval.c
diff --git a/Objects/abstract.c b/Objects/abstract.c
--- a/Objects/abstract.c
+++ b/Objects/abstract.c
@@ -331,7 +331,7 @@
{
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;
}
diff --git a/Python/ceval.c b/Python/ceval.c
--- a/Python/ceval.c
+++ b/Python/ceval.c
@@ -4130,7 +4130,7 @@
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);
--
Repository URL: http://hg.python.org/cpython
More information about the Python-checkins
mailing list