From: Walter Dörwald Date: Mon, 11 Jun 2007 15:00:18 +0000 (+0000) Subject: Simplify error formatting (no default encoding required). X-Git-Tag: v3.0a1~796 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=a29d1d7ff57e1e373c94a6423e16da0c4ec524f2;p=python Simplify error formatting (no default encoding required). --- diff --git a/Objects/funcobject.c b/Objects/funcobject.c index ff1b4c87e5..343e67c342 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++) {