mirror of
https://github.com/python/cpython.git
synced 2025-11-03 11:23:31 +00:00
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.
This commit is contained in:
parent
a1be88e24d
commit
ab61923637
1 changed files with 5 additions and 0 deletions
|
|
@ -4078,6 +4078,11 @@ PyString_Format(PyObject *format, PyObject *args)
|
||||||
break;
|
break;
|
||||||
case 's':
|
case 's':
|
||||||
#ifdef Py_USING_UNICODE
|
#ifdef Py_USING_UNICODE
|
||||||
|
if (PyUnicode_Check(v)) {
|
||||||
|
fmt = fmt_start;
|
||||||
|
argidx = argidx_start;
|
||||||
|
goto unicode;
|
||||||
|
}
|
||||||
temp = _PyObject_Str(v);
|
temp = _PyObject_Str(v);
|
||||||
if (temp != NULL && PyUnicode_Check(temp)) {
|
if (temp != NULL && PyUnicode_Check(temp)) {
|
||||||
Py_DECREF(temp);
|
Py_DECREF(temp);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue