diff options
author | Gregory P. Smith <greg@mad-scientist.com> | 2008-06-09 04:58:54 (GMT) |
---|---|---|
committer | Gregory P. Smith <greg@mad-scientist.com> | 2008-06-09 04:58:54 (GMT) |
commit | dd96db63f689e2f0d8ae5a1436b3b3395eec7de5 (patch) | |
tree | b2299acac9ce44fc488fc7b2ae2a44548cd5fbb8 /PC/_msi.c | |
parent | e98839a1f48b2915f1cc747884e64f4d6e4c8e7a (diff) | |
download | cpython-dd96db63f689e2f0d8ae5a1436b3b3395eec7de5.zip cpython-dd96db63f689e2f0d8ae5a1436b3b3395eec7de5.tar.gz cpython-dd96db63f689e2f0d8ae5a1436b3b3395eec7de5.tar.bz2 |
This reverts r63675 based on the discussion in this thread:
http://mail.python.org/pipermail/python-dev/2008-June/079988.html
Python 2.6 should stick with PyString_* in its codebase. The PyBytes_* names
in the spirit of 3.0 are available via a #define only. See the email thread.
Diffstat (limited to 'PC/_msi.c')
-rw-r--r-- | PC/_msi.c | 12 |
1 files changed, 6 insertions, 6 deletions
@@ -35,7 +35,7 @@ uuidcreate(PyObject* obj, PyObject*args) return NULL; } - oresult = PyBytes_FromString(cresult); + oresult = PyString_FromString(cresult); RpcStringFree(&cresult); return oresult; @@ -136,14 +136,14 @@ static FNFCIGETNEXTCABINET(cb_getnextcabinet) PyObject *result = PyObject_CallMethod(pv, "getnextcabinet", "i", pccab->iCab); if (result == NULL) return -1; - if (!PyBytes_Check(result)) { + if (!PyString_Check(result)) { PyErr_Format(PyExc_TypeError, "Incorrect return type %s from getnextcabinet", result->ob_type->tp_name); Py_DECREF(result); return FALSE; } - strncpy(pccab->szCab, PyBytes_AsString(result), sizeof(pccab->szCab)); + strncpy(pccab->szCab, PyString_AsString(result), sizeof(pccab->szCab)); return TRUE; } return FALSE; @@ -554,7 +554,7 @@ summary_getproperty(msiobj* si, PyObject *args) PyErr_SetString(PyExc_NotImplementedError, "FILETIME result"); return NULL; case VT_LPSTR: - result = PyBytes_FromStringAndSize(sval, ssize); + result = PyString_FromStringAndSize(sval, ssize); if (sval != sbuf) free(sval); return result; @@ -586,9 +586,9 @@ summary_setproperty(msiobj* si, PyObject *args) if (!PyArg_ParseTuple(args, "iO:SetProperty", &field, &data)) return NULL; - if (PyBytes_Check(data)) { + if (PyString_Check(data)) { status = MsiSummaryInfoSetProperty(si->h, field, VT_LPSTR, - 0, NULL, PyBytes_AsString(data)); + 0, NULL, PyString_AsString(data)); } else if (PyInt_Check(data)) { status = MsiSummaryInfoSetProperty(si->h, field, VT_I4, PyInt_AsLong(data), NULL, NULL); |