Simplify append_keyword_tzinfo() by using
PyUnicode_FromFormat().
This commit is contained in:
parent
85d8e421a6
commit
517bcfeb6b
|
@ -1055,16 +1055,8 @@ append_keyword_tzinfo(PyObject *repr, PyObject *tzinfo)
|
|||
Py_DECREF(repr);
|
||||
if (temp == NULL)
|
||||
return NULL;
|
||||
repr = temp;
|
||||
|
||||
/* Append ", tzinfo=". */
|
||||
PyUnicode_AppendAndDel(&repr, PyUnicode_FromString(", tzinfo="));
|
||||
|
||||
/* Append repr(tzinfo). */
|
||||
PyUnicode_AppendAndDel(&repr, PyObject_Repr(tzinfo));
|
||||
|
||||
/* Add a closing paren. */
|
||||
PyUnicode_AppendAndDel(&repr, PyUnicode_FromString(")"));
|
||||
repr = PyUnicode_FromFormat("%U, tzinfo=%R)", temp, tzinfo);
|
||||
Py_DECREF(temp);
|
||||
return repr;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue