mirror of
https://github.com/python/cpython.git
synced 2025-08-04 00:48:58 +00:00
[ Patch #102852 ] Make % error a bit more informative by indicates the
index at which an unknown %-escape was found
This commit is contained in:
parent
29c45a5e91
commit
6ca8917758
2 changed files with 6 additions and 4 deletions
|
@ -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) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue