diff options
author | Walter Dörwald <walter@livinglogic.de> | 2007-06-11 16:03:16 (GMT) |
---|---|---|
committer | Walter Dörwald <walter@livinglogic.de> | 2007-06-11 16:03:16 (GMT) |
commit | 5d4ede181128d17166de5b74e047eef12e9e6f47 (patch) | |
tree | f993b5687853b418bafb554c77dface37a8af24a /Python/symtable.c | |
parent | 75163600de0a6f4a4fe7cfc851cc6d3c517cb475 (diff) | |
download | cpython-5d4ede181128d17166de5b74e047eef12e9e6f47.zip cpython-5d4ede181128d17166de5b74e047eef12e9e6f47.tar.gz cpython-5d4ede181128d17166de5b74e047eef12e9e6f47.tar.bz2 |
Simplify ste_repr().
Diffstat (limited to 'Python/symtable.c')
-rw-r--r-- | Python/symtable.c | 10 |
1 files changed, 3 insertions, 7 deletions
diff --git a/Python/symtable.c b/Python/symtable.c index 5df7318..0f7642a 100644 --- a/Python/symtable.c +++ b/Python/symtable.c @@ -88,13 +88,9 @@ PySTEntry_New(struct symtable *st, identifier name, _Py_block_ty block, 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 |