From a29d1d7ff57e1e373c94a6423e16da0c4ec524f2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Walter=20D=C3=B6rwald?= Date: Mon, 11 Jun 2007 15:00:18 +0000 Subject: Simplify error formatting (no default encoding required). --- Objects/funcobject.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/Objects/funcobject.c b/Objects/funcobject.c index ff1b4c8..343e67c 100644 --- a/Objects/funcobject.c +++ b/Objects/funcobject.c @@ -515,9 +515,8 @@ func_new(PyTypeObject* type, PyObject* args, PyObject* kw) nclosure = closure == Py_None ? 0 : PyTuple_GET_SIZE(closure); if (nfree != nclosure) return PyErr_Format(PyExc_ValueError, - "%s requires closure of length %zd, not %zd", - PyUnicode_AsString(code->co_name), - nfree, nclosure); + "%U requires closure of length %zd, not %zd", + code->co_name, nfree, nclosure); if (nclosure) { Py_ssize_t i; for (i = 0; i < nclosure; i++) { -- cgit v0.12