From: Neil Schemenauer Date: Wed, 31 Aug 2005 23:02:05 +0000 (+0000) Subject: Fix bug in last checkin (2.231). To match previous behavior, unicode X-Git-Tag: v2.5a0~1414 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=ab6192363775022dffc7384bf04c03a8130d47ed;p=thirdparty%2FPython%2Fcpython.git Fix bug in last checkin (2.231). To match previous behavior, unicode subclasses should be substituted as-is and not have tp_str called on them. --- diff --git a/Objects/stringobject.c b/Objects/stringobject.c index 9bcae0ff2c7a..05deb3a98c77 100644 --- a/Objects/stringobject.c +++ b/Objects/stringobject.c @@ -4078,6 +4078,11 @@ PyString_Format(PyObject *format, PyObject *args) break; case 's': #ifdef Py_USING_UNICODE + if (PyUnicode_Check(v)) { + fmt = fmt_start; + argidx = argidx_start; + goto unicode; + } temp = _PyObject_Str(v); if (temp != NULL && PyUnicode_Check(temp)) { Py_DECREF(temp);