summaryrefslogtreecommitdiffstats
path: root/Objects
diff options
context:
space:
mode:
authorWalter Dörwald <walter@livinglogic.de>2007-06-06 15:15:34 (GMT)
committerWalter Dörwald <walter@livinglogic.de>2007-06-06 15:15:34 (GMT)
commit933daed9227fa7d6fcb63f411a51782777c15dfc (patch)
tree5d1cdf56626cbb1230215bdfd2b709b510c7bd15 /Objects
parent2a0c081470cc652c35d3bf60f77734d407832136 (diff)
downloadcpython-933daed9227fa7d6fcb63f411a51782777c15dfc.zip
cpython-933daed9227fa7d6fcb63f411a51782777c15dfc.tar.gz
cpython-933daed9227fa7d6fcb63f411a51782777c15dfc.tar.bz2
Use PyUnicode_FromFormat() directly.
Diffstat (limited to 'Objects')
-rw-r--r--Objects/codeobject.c8
1 files changed, 3 insertions, 5 deletions
diff --git a/Objects/codeobject.c b/Objects/codeobject.c
index fc7a7db..6763950 100644
--- a/Objects/codeobject.c
+++ b/Objects/codeobject.c
@@ -286,7 +286,6 @@ code_dealloc(PyCodeObject *co)
static PyObject *
code_repr(PyCodeObject *co)
{
- char buf[500];
int lineno = -1;
char *filename = "???";
char *name = "???";
@@ -297,10 +296,9 @@ code_repr(PyCodeObject *co)
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 *