Author: Antonio Cuni <anto.c...@gmail.com> Branch: py3k Changeset: r53682:16e67dc2726d Date: 2012-03-15 16:31 +0100 http://bitbucket.org/pypy/pypy/changeset/16e67dc2726d/
Log: make sure to call __str__ when formatting subclasses of str. This fixes test_format_unicode_subclass diff --git a/pypy/objspace/std/newformat.py b/pypy/objspace/std/newformat.py --- a/pypy/objspace/std/newformat.py +++ b/pypy/objspace/std/newformat.py @@ -553,7 +553,7 @@ def format_string(self, w_string): space = self.space - if not space.isinstance_w(w_string, space.w_unicode): + if not space.is_w(space.type(w_string), space.w_unicode): w_string = space.str(w_string) string = space.unicode_w(w_string) if self._parse_spec("s", "<"): _______________________________________________ pypy-commit mailing list pypy-commit@python.org http://mail.python.org/mailman/listinfo/pypy-commit