diff options
Diffstat (limited to 'Python/mactoolboxglue.c')
-rw-r--r-- | Python/mactoolboxglue.c | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/Python/mactoolboxglue.c b/Python/mactoolboxglue.c index 8ad0d6d..e96bb64 100644 --- a/Python/mactoolboxglue.c +++ b/Python/mactoolboxglue.c @@ -52,7 +52,7 @@ PyMac_StrError(int err) buf[0] = '\0'; } else { - char *input = PyString_AsString(rv); + char *input = PyBytes_AsString(rv); if (!input) { PyErr_Clear(); buf[0] = '\0'; @@ -124,7 +124,7 @@ PyMac_GetFullPathname(FSSpec *fss, char *path, int len) if (!rv) goto error; - input = PyString_AsString(rv); + input = PyBytes_AsString(rv); if (!input) goto error; @@ -159,12 +159,12 @@ int PyMac_GetOSType(PyObject *v, OSType *pr) { uint32_t tmp; - if (!PyString_Check(v) || PyString_Size(v) != 4) { + if (!PyBytes_Check(v) || PyBytes_Size(v) != 4) { PyErr_SetString(PyExc_TypeError, "OSType arg must be string of 4 chars"); return 0; } - memcpy((char *)&tmp, PyString_AsString(v), 4); + memcpy((char *)&tmp, PyBytes_AsString(v), 4); *pr = (OSType)ntohl(tmp); return 1; } @@ -174,7 +174,7 @@ PyObject * PyMac_BuildOSType(OSType t) { uint32_t tmp = htonl((uint32_t)t); - return PyString_FromStringAndSize((char *)&tmp, 4); + return PyBytes_FromStringAndSize((char *)&tmp, 4); } /* Convert an NumVersion value to a 4-element tuple */ @@ -190,13 +190,13 @@ int PyMac_GetStr255(PyObject *v, Str255 pbuf) { int len; - if (!PyString_Check(v) || (len = PyString_Size(v)) > 255) { + if (!PyBytes_Check(v) || (len = PyBytes_Size(v)) > 255) { PyErr_SetString(PyExc_TypeError, "Str255 arg must be string of at most 255 chars"); return 0; } pbuf[0] = len; - memcpy((char *)(pbuf+1), PyString_AsString(v), len); + memcpy((char *)(pbuf+1), PyBytes_AsString(v), len); return 1; } @@ -208,7 +208,7 @@ PyMac_BuildStr255(Str255 s) PyErr_SetString(PyExc_SystemError, "Str255 pointer is NULL"); return NULL; } - return PyString_FromStringAndSize((char *)&s[1], (int)s[0]); + return PyBytes_FromStringAndSize((char *)&s[1], (int)s[0]); } PyObject * @@ -218,7 +218,7 @@ PyMac_BuildOptStr255(Str255 s) Py_INCREF(Py_None); return Py_None; } - return PyString_FromStringAndSize((char *)&s[1], (int)s[0]); + return PyBytes_FromStringAndSize((char *)&s[1], (int)s[0]); } |