diff options
Diffstat (limited to 'Python/structmember.c')
-rw-r--r-- | Python/structmember.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/Python/structmember.c b/Python/structmember.c index d2305903303..5ebe28331f0 100644 --- a/Python/structmember.c +++ b/Python/structmember.c @@ -16,7 +16,7 @@ listmembers(struct memberlist *mlist) if (v != NULL) { for (i = 0; i < n; i++) PyList_SetItem(v, i, - PyString_FromString(mlist[i].name)); + PyBytes_FromString(mlist[i].name)); if (PyErr_Occurred()) { Py_DECREF(v); v = NULL; @@ -103,13 +103,13 @@ PyMember_GetOne(const char *addr, PyMemberDef *l) v = Py_None; } else - v = PyString_FromString(*(char**)addr); + v = PyBytes_FromString(*(char**)addr); break; case T_STRING_INPLACE: - v = PyString_FromString((char*)addr); + v = PyBytes_FromString((char*)addr); break; case T_CHAR: - v = PyString_FromStringAndSize((char*)addr, 1); + v = PyBytes_FromStringAndSize((char*)addr, 1); break; case T_OBJECT: v = *(PyObject **)addr; @@ -310,8 +310,8 @@ PyMember_SetOne(char *addr, PyMemberDef *l, PyObject *v) Py_XDECREF(oldv); break; case T_CHAR: - if (PyString_Check(v) && PyString_Size(v) == 1) { - *(char*)addr = PyString_AsString(v)[0]; + if (PyBytes_Check(v) && PyBytes_Size(v) == 1) { + *(char*)addr = PyBytes_AsString(v)[0]; } else { PyErr_BadArgument(); |