diff options
Diffstat (limited to 'Objects/methodobject.c')
-rw-r--r-- | Objects/methodobject.c | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/Objects/methodobject.c b/Objects/methodobject.c index cdba3505f9..e766ba5e89 100644 --- a/Objects/methodobject.c +++ b/Objects/methodobject.c @@ -172,15 +172,13 @@ static struct getsetlist meth_getsets [] = { static PyObject * meth_repr(PyCFunctionObject *m) { - char buf[200]; if (m->m_self == NULL) - sprintf(buf, "<built-in function %.80s>", m->m_ml->ml_name); - else - sprintf(buf, - "<built-in method %.80s of %.80s object at %p>", - m->m_ml->ml_name, m->m_self->ob_type->tp_name, - m->m_self); - return PyString_FromString(buf); + return PyString_FromFormat("<built-in function %s>", + m->m_ml->ml_name); + return PyString_FromFormat("<built-in method %s of %s object at %p>", + m->m_ml->ml_name, + m->m_self->ob_type->tp_name, + m->m_self); } static int |