Bug 3440044
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@12842 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
parent
3aafb96325
commit
959fdf2053
2 changed files with 10 additions and 3 deletions
|
|
@ -1721,6 +1721,7 @@ SWIG_Python_MustGetPtr(PyObject *obj, swig_type_info *ty, int SWIGUNUSEDPARM(arg
|
|||
return result;
|
||||
}
|
||||
|
||||
#ifdef SWIGPYTHON_BUILTIN
|
||||
SWIGRUNTIME int
|
||||
SWIG_Python_NonDynamicSetAttr(PyObject *obj, PyObject *name, PyObject *value) {
|
||||
PyTypeObject *tp = obj->ob_type;
|
||||
|
|
@ -1729,15 +1730,15 @@ SWIG_Python_NonDynamicSetAttr(PyObject *obj, PyObject *name, PyObject *value) {
|
|||
descrsetfunc f;
|
||||
int res;
|
||||
|
||||
#ifdef Py_USING_UNICODE
|
||||
# ifdef Py_USING_UNICODE
|
||||
if (PyString_Check(name)) {
|
||||
name = PyUnicode_Decode(PyString_AsString(name), PyString_Size(name), NULL, NULL);
|
||||
if (!name)
|
||||
return -1;
|
||||
} else if (!PyUnicode_Check(name))
|
||||
#else
|
||||
# else
|
||||
if (!PyString_Check(name))
|
||||
#endif
|
||||
# endif
|
||||
{
|
||||
PyErr_Format(PyExc_TypeError, "attribute name must be string, not '%.200s'", name->ob_type->tp_name);
|
||||
return -1;
|
||||
|
|
@ -1772,6 +1773,7 @@ SWIG_Python_NonDynamicSetAttr(PyObject *obj, PyObject *name, PyObject *value) {
|
|||
Py_DECREF(name);
|
||||
return res;
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue