mirror of
https://github.com/python/cpython.git
synced 2024-11-25 02:44:06 +08:00
Simplify error formatting (no default encoding required).
This commit is contained in:
parent
7815c5e91e
commit
a29d1d7ff5
@ -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++) {
|
||||
|
Loading…
Reference in New Issue
Block a user