diff options
Diffstat (limited to 'Objects')
-rw-r--r-- | Objects/stringlib/string_format.h | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/Objects/stringlib/string_format.h b/Objects/stringlib/string_format.h index 600e6b0..6c531e8 100644 --- a/Objects/stringlib/string_format.h +++ b/Objects/stringlib/string_format.h @@ -329,8 +329,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; } |