Commit a29d1d7f authored by Walter Dörwald's avatar Walter Dörwald

Simplify error formatting (no default encoding required).

parent 7815c5e9
...@@ -515,9 +515,8 @@ func_new(PyTypeObject* type, PyObject* args, PyObject* kw) ...@@ -515,9 +515,8 @@ func_new(PyTypeObject* type, PyObject* args, PyObject* kw)
nclosure = closure == Py_None ? 0 : PyTuple_GET_SIZE(closure); nclosure = closure == Py_None ? 0 : PyTuple_GET_SIZE(closure);
if (nfree != nclosure) if (nfree != nclosure)
return PyErr_Format(PyExc_ValueError, return PyErr_Format(PyExc_ValueError,
"%s requires closure of length %zd, not %zd", "%U requires closure of length %zd, not %zd",
PyUnicode_AsString(code->co_name), code->co_name, nfree, nclosure);
nfree, nclosure);
if (nclosure) { if (nclosure) {
Py_ssize_t i; Py_ssize_t i;
for (i = 0; i < nclosure; i++) { for (i = 0; i < nclosure; i++) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment