We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent fc3cddd commit fe9f6e8Copy full SHA for fe9f6e8
Objects/unicodeobject.c
@@ -13929,7 +13929,12 @@ _PyUnicodeWriter_WriteStr(_PyUnicodeWriter *writer, PyObject *str)
13929
int
13930
PyUnicodeWriter_WriteStr(PyUnicodeWriter *writer, PyObject *obj)
13931
{
13932
- if (Py_TYPE(obj) == &PyLong_Type) {
+ PyTypeObject *type = Py_TYPE(obj);
13933
+ if (type == &PyUnicode_Type) {
13934
+ return _PyUnicodeWriter_WriteStr((_PyUnicodeWriter*)writer, obj);
13935
+ }
13936
+
13937
+ if (type == &PyLong_Type) {
13938
return _PyLong_FormatWriter((_PyUnicodeWriter*)writer, obj, 10, 0);
13939
}
13940
0 commit comments