Author: walter.doerwald
Date: Wed Jun  6 17:15:34 2007
New Revision: 55787

Modified:
   python/branches/py3k-struni/Objects/codeobject.c
Log:
Use PyUnicode_FromFormat() directly.


Modified: python/branches/py3k-struni/Objects/codeobject.c
==============================================================================
--- python/branches/py3k-struni/Objects/codeobject.c    (original)
+++ python/branches/py3k-struni/Objects/codeobject.c    Wed Jun  6 17:15:34 2007
@@ -286,7 +286,6 @@
 static PyObject *
 code_repr(PyCodeObject *co)
 {
-       char buf[500];
        int lineno = -1;
        char *filename = "???";
        char *name = "???";
@@ -297,10 +296,9 @@
                filename = PyString_AS_STRING(co->co_filename);
        if (co->co_name && PyString_Check(co->co_name))
                name = PyString_AS_STRING(co->co_name);
-       PyOS_snprintf(buf, sizeof(buf),
-                     "<code object %.100s at %p, file \"%.300s\", line %d>",
-                     name, co, filename, lineno);
-       return PyUnicode_FromString(buf);
+       return PyUnicode_FromFormat(
+                       "<code object %.100s at %p, file \"%.300s\", line %d>",
+                       name, co, filename, lineno);
 }
 
 static PyObject *
_______________________________________________
Python-3000-checkins mailing list
[email protected]
http://mail.python.org/mailman/listinfo/python-3000-checkins

Reply via email to