summaryrefslogtreecommitdiffstats
path: root/Modules/_elementtree.c
diff options
context:
space:
mode:
Diffstat (limited to 'Modules/_elementtree.c')
-rw-r--r--Modules/_elementtree.c12
1 files changed, 1 insertions, 11 deletions
diff --git a/Modules/_elementtree.c b/Modules/_elementtree.c
index 442ab83..2ec2332 100644
--- a/Modules/_elementtree.c
+++ b/Modules/_elementtree.c
@@ -1118,17 +1118,7 @@ element_remove(ElementObject* self, PyObject* args)
static PyObject*
element_repr(ElementObject* self)
{
- PyObject* repr;
- char buffer[100];
-
- repr = PyUnicode_FromString("<Element ");
-
- PyUnicode_AppendAndDel(&repr, PyObject_Repr(self->tag));
-
- sprintf(buffer, " at %p>", self);
- PyUnicode_AppendAndDel(&repr, PyUnicode_FromString(buffer));
-
- return repr;
+ return PyUnicode_FromFormat("<Element %R at %p>", self->tag, self);
}
static PyObject*