Commit 9843bc11 authored by Francisco Couzo's avatar Francisco Couzo Committed by Raymond Hettinger

Improve exception message for str.format (GH-12675)

parent cd74e66a
...@@ -440,8 +440,13 @@ get_field_object(SubString *input, PyObject *args, PyObject *kwargs, ...@@ -440,8 +440,13 @@ get_field_object(SubString *input, PyObject *args, PyObject *kwargs,
/* look up in args */ /* look up in args */
obj = PySequence_GetItem(args, index); obj = PySequence_GetItem(args, index);
if (obj == NULL) if (obj == NULL) {
goto error; PyErr_Format(PyExc_IndexError,
"Replacement index %zd out of range for positional "
"args tuple",
index);
goto error;
}
} }
/* iterate over the rest of the field_name */ /* iterate over the rest of the field_name */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment