SF patch# 1761465 by Jeffrey Yasskin.

Fix test_aepack and test_applesingle.
This commit is contained in:
Guido van Rossum 2007-07-27 04:41:00 +00:00
parent 67feb09d06
commit f7a94e4b44
7 changed files with 126 additions and 104 deletions

View file

@ -194,7 +194,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 */
@ -215,7 +215,7 @@ PyMac_GetStr255(PyObject *v, Str255 pbuf)
if (PyUnicode_Check(v)) {
v = _PyUnicode_AsDefaultEncodedString(v, NULL);
if (v == NULL)
return NULL;
return 0;
}
if (PyString_Check(v)) {
ptr = PyString_AS_STRING(v);