Eliminate -Wformat compiler warning.
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/branches/szager-python-builtin@12575 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
parent
bc200998b1
commit
e43d328c61
1 changed files with 9 additions and 1 deletions
|
|
@ -1685,6 +1685,7 @@ SWIGRUNTIME int
|
||||||
SWIG_Python_NonDynamicSetAttr(PyObject *obj, PyObject *name, PyObject *value) {
|
SWIG_Python_NonDynamicSetAttr(PyObject *obj, PyObject *name, PyObject *value) {
|
||||||
PyTypeObject *tp = obj->ob_type;
|
PyTypeObject *tp = obj->ob_type;
|
||||||
PyObject *descr;
|
PyObject *descr;
|
||||||
|
PyObject *encoded_name;
|
||||||
descrsetfunc f;
|
descrsetfunc f;
|
||||||
int res;
|
int res;
|
||||||
|
|
||||||
|
|
@ -1714,7 +1715,14 @@ SWIG_Python_NonDynamicSetAttr(PyObject *obj, PyObject *name, PyObject *value) {
|
||||||
if (descr != NULL)
|
if (descr != NULL)
|
||||||
f = descr->ob_type->tp_descr_set;
|
f = descr->ob_type->tp_descr_set;
|
||||||
if (!f) {
|
if (!f) {
|
||||||
PyErr_Format(PyExc_AttributeError, "'%.100s' object has no attribute '%.200S'", tp->tp_name, name);
|
if (PyString_Check(name)) {
|
||||||
|
encoded_name = name;
|
||||||
|
Py_INCREF(name);
|
||||||
|
} else {
|
||||||
|
encoded_name = PyUnicode_AsUTF8String(name);
|
||||||
|
}
|
||||||
|
PyErr_Format(PyExc_AttributeError, "'%.100s' object has no attribute '%.200s'", tp->tp_name, PyString_AsString(encoded_name));
|
||||||
|
Py_DECREF(encoded_name);
|
||||||
} else {
|
} else {
|
||||||
res = f(descr, obj, value);
|
res = f(descr, obj, value);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue