Mercurial > cpython-lru_cache-weakref
diff Python/exceptions.c @ 27674:ce3faab06de7 legacy-trunk
filterstring() and filterunicode() in Python/bltinmodule.c
blindly assumed that tp_as_sequence->sq_item always returns
a str or unicode object. This might fail with str or unicode
subclasses.
This patch checks whether the object returned from __getitem__
is a str/unicode object and raises a TypeError if not (and
the filter function returned true).
Furthermore the result for __getitem__ can be more than one
character long, so checks for enough memory have to be done.
| author | Walter Dörwald <walter@livinglogic.de> |
|---|---|
| date | Tue, 04 Feb 2003 16:28:00 +0000 |
| parents | faabd9867fb8 |
| children | b38cebc76d82 |
