Mercurial > cpython-lru_cache-weakref
diff Python/symtable.c @ 42042:e0f927414dfa
Simplify ste_repr().
| author | Walter Dörwald <walter@livinglogic.de> |
|---|---|
| date | Mon, 11 Jun 2007 16:03:16 +0000 |
| parents | cd125fe83051 |
| children | 61fd5444d95f |
line wrap: on
line diff
--- a/Python/symtable.c Mon Jun 11 15:47:13 2007 +0000 +++ b/Python/symtable.c Mon Jun 11 16:03:16 2007 +0000 @@ -88,13 +88,9 @@ static PyObject * ste_repr(PySTEntryObject *ste) { - char buf[256]; - - PyOS_snprintf(buf, sizeof(buf), - "<symtable entry %.100s(%ld), line %d>", - PyUnicode_AsString(ste->ste_name), - PyInt_AS_LONG(ste->ste_id), ste->ste_lineno); - return PyUnicode_FromString(buf); + return PyUnicode_FromFormat("<symtable entry %U(%ld), line %d>", + ste->ste_name, + PyInt_AS_LONG(ste->ste_id), ste->ste_lineno); } static void
