Mercurial > cpython-lru_cache-weakref
diff Objects/stringlib/string_format.h @ 62185:b5af5c93135b 3.1
Merged revisions 81823,81835 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/branches/py3k
................
r81823 | benjamin.peterson | 2010-06-07 17:31:26 -0500 (Mon, 07 Jun 2010) | 9 lines
Merged revisions 81820 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/trunk
........
r81820 | benjamin.peterson | 2010-06-07 17:23:23 -0500 (Mon, 07 Jun 2010) | 1 line
correctly overflow when indexes are too large
........
................
r81835 | benjamin.peterson | 2010-06-08 09:57:22 -0500 (Tue, 08 Jun 2010) | 9 lines
Merged revisions 81834 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/trunk
........
r81834 | benjamin.peterson | 2010-06-08 09:53:29 -0500 (Tue, 08 Jun 2010) | 1 line
kill extra word
........
................
| author | Benjamin Peterson <benjamin@python.org> |
|---|---|
| date | Tue, 08 Jun 2010 15:12:17 +0000 |
| parents | f197407bdba2 |
| children | 0991b40e895d fd044cda97d8 |
line wrap: on
line diff
--- a/Objects/stringlib/string_format.h Tue Jun 08 14:43:46 2010 +0000 +++ b/Objects/stringlib/string_format.h Tue Jun 08 15:12:17 2010 +0000 @@ -373,6 +373,8 @@ if (_FieldNameIterator_item(self, name) == 0) return 0; *name_idx = get_integer(name); + if (*name_idx == -1 && PyErr_Occurred()) + return 0; break; default: /* Invalid character follows ']' */ @@ -429,6 +431,8 @@ /* see if "first" is an integer, in which case it's used as an index */ *first_idx = get_integer(first); + if (*first_idx == -1 && PyErr_Occurred()) + return 0; field_name_is_empty = first->ptr >= first->end;
