Commit ce9e3c3a authored by Gregory P. Smith's avatar Gregory P. Smith

Silence a -Wformat-extra-argument warning when compiling.

parent 6214d493
......@@ -167,13 +167,21 @@ weakref_repr(PyWeakReference *self)
PyErr_Clear();
else if (PyUnicode_Check(nameobj))
name = _PyUnicode_AsString(nameobj);
PyOS_snprintf(buffer, sizeof(buffer),
name ? "<weakref at %p; to '%.50s' at %p (%s)>"
: "<weakref at %p; to '%.50s' at %p>",
self,
Py_TYPE(PyWeakref_GET_OBJECT(self))->tp_name,
PyWeakref_GET_OBJECT(self),
name);
if (name != NULL) {
PyOS_snprintf(buffer, sizeof(buffer),
"<weakref at %p; to '%.50s' at %p (%s)>",
self,
Py_TYPE(PyWeakref_GET_OBJECT(self))->tp_name,
PyWeakref_GET_OBJECT(self),
name);
}
else {
PyOS_snprintf(buffer, sizeof(buffer),
"<weakref at %p; to '%.50s' at %p>",
self,
Py_TYPE(PyWeakref_GET_OBJECT(self))->tp_name,
PyWeakref_GET_OBJECT(self));
}
Py_XDECREF(nameobj);
}
return PyUnicode_FromString(buffer);
......
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