summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNeil Schemenauer <nascheme@enme.ucalgary.ca>2005-08-31 23:02:05 (GMT)
committerNeil Schemenauer <nascheme@enme.ucalgary.ca>2005-08-31 23:02:05 (GMT)
commitab6192363775022dffc7384bf04c03a8130d47ed (patch)
treebdf937a656ab3abef57e9403e81f97cfa6758e2e
parenta1be88e24d4a9e72f89c755026bb00a5cad59e97 (diff)
downloadcpython-ab6192363775022dffc7384bf04c03a8130d47ed.zip
cpython-ab6192363775022dffc7384bf04c03a8130d47ed.tar.gz
cpython-ab6192363775022dffc7384bf04c03a8130d47ed.tar.bz2
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.
-rw-r--r--Objects/stringobject.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/Objects/stringobject.c b/Objects/stringobject.c
index 9bcae0f..05deb3a 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);