diff Objects/stringobject.c @ 35503:f63e6960c5cf legacy-trunk

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.
author Neil Schemenauer <nascheme@enme.ucalgary.ca>
date Wed, 31 Aug 2005 23:02:05 +0000
parents ef11cbc08dab
children dc5d706283d6
line wrap: on
line diff
--- a/Objects/stringobject.c	Wed Aug 31 22:48:45 2005 +0000
+++ b/Objects/stringobject.c	Wed Aug 31 23:02:05 2005 +0000
@@ -4078,6 +4078,11 @@
 				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);