diff options
Diffstat (limited to 'Objects')
| -rw-r--r-- | Objects/object.c | 8 | ||||
| -rw-r--r-- | Objects/unicodeobject.c | 4 |
2 files changed, 6 insertions, 6 deletions
diff --git a/Objects/object.c b/Objects/object.c index 7b80bcb91d..93cdc1014f 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; } diff --git a/Objects/unicodeobject.c b/Objects/unicodeobject.c index 5fbe56cce1..b711f0ccce 100644 --- a/Objects/unicodeobject.c +++ b/Objects/unicodeobject.c @@ -3972,7 +3972,7 @@ PyUnicode_FSDecoder(PyObject* arg, void* addr) } -char* +const char * PyUnicode_AsUTF8AndSize(PyObject *unicode, Py_ssize_t *psize) { PyObject *bytes; @@ -4007,7 +4007,7 @@ PyUnicode_AsUTF8AndSize(PyObject *unicode, Py_ssize_t *psize) return PyUnicode_UTF8(unicode); } -char* +const char * PyUnicode_AsUTF8(PyObject *unicode) { return PyUnicode_AsUTF8AndSize(unicode, NULL); |
