fix format spec recursive expansion (closes #19729)

This commit is contained in:
Benjamin Peterson 2013-11-26 19:22:36 -06:00
parent bb65b5bf1d
commit 0ee22bf774
3 changed files with 7 additions and 2 deletions

View file

@ -727,8 +727,10 @@ MarkupIterator_next(MarkupIterator *self, SubString *literal,
while (self->str.start < self->str.end) {
switch (c = PyUnicode_READ_CHAR(self->str.str, self->str.start++)) {
case ':':
hit_format_spec = 1;
count = 1;
if (!hit_format_spec) {
count = 1;
hit_format_spec = 1;
}
break;
case '{':
/* the format spec needs to be recursively expanded.