int
PyUnicodeWriter_WriteStr(PyUnicodeWriter *writer, PyObject *obj)
{
+ if (Py_TYPE(obj) == &PyLong_Type) {
+ return _PyLong_FormatWriter((_PyUnicodeWriter*)writer, obj, 10, 0);
+ }
+
PyObject *str = PyObject_Str(obj);
if (str == NULL) {
return -1;
int
PyUnicodeWriter_WriteRepr(PyUnicodeWriter *writer, PyObject *obj)
{
+ if (Py_TYPE(obj) == &PyLong_Type) {
+ return _PyLong_FormatWriter((_PyUnicodeWriter*)writer, obj, 10, 0);
+ }
+
PyObject *repr = PyObject_Repr(obj);
if (repr == NULL) {
return -1;