diff options
author | Walter Dörwald <walter@livinglogic.de> | 2007-06-11 16:03:16 +0000 |
---|---|---|
committer | Walter Dörwald <walter@livinglogic.de> | 2007-06-11 16:03:16 +0000 |
commit | 697584192aa854f88c4b658050e71602f69b2281 (patch) | |
tree | 1b243123549da71b50ed4bf5e2843fab4d937371 /Python/symtable.c | |
parent | 733343ea9f9b1e118f9205fcf9c0c4661b4ee5f3 (diff) | |
download | cpython-697584192aa854f88c4b658050e71602f69b2281.tar.gz |
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 5df7318d17..0f7642a2c5 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 |