summaryrefslogtreecommitdiffstats
path: root/Objects/object.c
diff options
context:
space:
mode:
authorSerhiy Storchaka <storchaka@gmail.com>2017-01-22 21:07:07 (GMT)
committerSerhiy Storchaka <storchaka@gmail.com>2017-01-22 21:07:07 (GMT)
commit2a404b63d48d73bbaa007d89efb7a01048475acd (patch)
tree66a217f6efa01478ca1741218fb059112675b0f1 /Objects/object.c
parentd528791096694307884762eebc8ec6fed279f302 (diff)
downloadcpython-2a404b63d48d73bbaa007d89efb7a01048475acd.zip
cpython-2a404b63d48d73bbaa007d89efb7a01048475acd.tar.gz
cpython-2a404b63d48d73bbaa007d89efb7a01048475acd.tar.bz2
Issue #28769: The result of PyUnicode_AsUTF8AndSize() and PyUnicode_AsUTF8()
is now of type "const char *" rather of "char *".
Diffstat (limited to 'Objects/object.c')
-rw-r--r--Objects/object.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/Objects/object.c b/Objects/object.c
index 7b80bcb..93cdc10 100644
--- a/Objects/object.c
+++ b/Objects/object.c
@@ -890,10 +890,10 @@ PyObject_GetAttr(PyObject *v, PyObject *name)
if (tp->tp_getattro != NULL)
return (*tp->tp_getattro)(v, name);
if (tp->tp_getattr != NULL) {
- char *name_str = PyUnicode_AsUTF8(name);
+ const char *name_str = PyUnicode_AsUTF8(name);
if (name_str == NULL)
return NULL;
- return (*tp->tp_getattr)(v, name_str);
+ return (*tp->tp_getattr)(v, (char *)name_str);
}
PyErr_Format(PyExc_AttributeError,
"'%.50s' object has no attribute '%U'",
@@ -934,10 +934,10 @@ PyObject_SetAttr(PyObject *v, PyObject *name, PyObject *value)
return err;
}
if (tp->tp_setattr != NULL) {
- char *name_str = PyUnicode_AsUTF8(name);
+ const char *name_str = PyUnicode_AsUTF8(name);
if (name_str == NULL)
return -1;
- err = (*tp->tp_setattr)(v, name_str, value);
+ err = (*tp->tp_setattr)(v, (char *)name_str, value);
Py_DECREF(name);
return err;
}