summaryrefslogtreecommitdiffstats
path: root/Objects/cellobject.c
diff options
context:
space:
mode:
Diffstat (limited to 'Objects/cellobject.c')
-rw-r--r--Objects/cellobject.c12
1 files changed, 5 insertions, 7 deletions
diff --git a/Objects/cellobject.c b/Objects/cellobject.c
index 9a36776..47e5174 100644
--- a/Objects/cellobject.c
+++ b/Objects/cellobject.c
@@ -62,14 +62,12 @@ cell_compare(PyCellObject *a, PyCellObject *b)
static PyObject *
cell_repr(PyCellObject *op)
{
- char buf[256];
-
if (op->ob_ref == NULL)
- sprintf(buf, "<cell at %p: empty>", op);
- else
- sprintf(buf, "<cell at %p: %.80s object at %p>",
- op, op->ob_ref->ob_type->tp_name, op->ob_ref);
- return PyString_FromString(buf);
+ return PyString_FromFormat("<cell at %p: empty>", op);
+
+ return PyString_FromFormat("<cell at %p: %.80s object at %p>",
+ op, op->ob_ref->ob_type->tp_name,
+ op->ob_ref);
}
static int