summaryrefslogtreecommitdiffstats
path: root/Objects/unicodeobject.c
diff options
context:
space:
mode:
authorAndrew M. Kuchling <amk@amk.ca>2000-12-15 13:07:46 (GMT)
committerAndrew M. Kuchling <amk@amk.ca>2000-12-15 13:07:46 (GMT)
commit6ca8917758c90bb8de4d3698f9c6ba84167035f5 (patch)
treeb2435c85b827e303c3c2793aa0be46cec2a650be /Objects/unicodeobject.c
parent29c45a5e91e3fc2e35fdfaf75ee58f2a204e84ce (diff)
downloadcpython-6ca8917758c90bb8de4d3698f9c6ba84167035f5.zip
cpython-6ca8917758c90bb8de4d3698f9c6ba84167035f5.tar.gz
cpython-6ca8917758c90bb8de4d3698f9c6ba84167035f5.tar.bz2
[ Patch #102852 ] Make % error a bit more informative by indicates the
index at which an unknown %-escape was found
Diffstat (limited to 'Objects/unicodeobject.c')
-rw-r--r--Objects/unicodeobject.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/Objects/unicodeobject.c b/Objects/unicodeobject.c
index a297cac..5ee72bd 100644
--- a/Objects/unicodeobject.c
+++ b/Objects/unicodeobject.c
@@ -5067,8 +5067,9 @@ PyObject *PyUnicode_Format(PyObject *format,
default:
PyErr_Format(PyExc_ValueError,
- "unsupported format character '%c' (0x%x)",
- c, c);
+ "unsupported format character '%c' (0x%x) "
+ "at index %i",
+ c, c, fmt -1 - PyUnicode_AS_UNICODE(uformat));
goto onError;
}
if (sign) {