summaryrefslogtreecommitdiffstats
path: root/Objects/stringlib
diff options
context:
space:
mode:
Diffstat (limited to 'Objects/stringlib')
-rw-r--r--Objects/stringlib/string_format.h5
1 files changed, 3 insertions, 2 deletions
diff --git a/Objects/stringlib/string_format.h b/Objects/stringlib/string_format.h
index ce7c909..ee6533e 100644
--- a/Objects/stringlib/string_format.h
+++ b/Objects/stringlib/string_format.h
@@ -375,8 +375,9 @@ FieldNameIterator_next(FieldNameIterator *self, int *is_attribute,
*name_idx = get_integer(name);
break;
default:
- /* interal error, can't get here */
- assert(0);
+ /* Invalid character follows ']' */
+ PyErr_SetString(PyExc_ValueError, "Only '.' or '[' may "
+ "follow ']' in format field specifier");
return 0;
}