[Python-3000-checkins] r55897 - python/branches/py3k-struni/Python/symtable.c

walter.doerwald python-3000-checkins at python.org
Mon Jun 11 18:03:26 CEST 2007


Author: walter.doerwald
Date: Mon Jun 11 18:03:16 2007
New Revision: 55897

Modified:
   python/branches/py3k-struni/Python/symtable.c
Log:
Simplify ste_repr().


Modified: python/branches/py3k-struni/Python/symtable.c
==============================================================================
--- python/branches/py3k-struni/Python/symtable.c	(original)
+++ python/branches/py3k-struni/Python/symtable.c	Mon Jun 11 18:03:16 2007
@@ -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


More information about the Python-3000-checkins mailing list