mirror of
https://github.com/python/cpython.git
synced 2025-08-03 08:34:29 +00:00
Renamed PyString to PyBytes
This commit is contained in:
parent
9c4756ea26
commit
72b710a596
78 changed files with 983 additions and 983 deletions
12
PC/_msi.c
12
PC/_msi.c
|
@ -35,7 +35,7 @@ uuidcreate(PyObject* obj, PyObject*args)
|
|||
return NULL;
|
||||
}
|
||||
|
||||
oresult = PyString_FromString(cresult);
|
||||
oresult = PyBytes_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 (!PyString_Check(result)) {
|
||||
if (!PyBytes_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, PyString_AsString(result), sizeof(pccab->szCab));
|
||||
strncpy(pccab->szCab, PyBytes_AsString(result), sizeof(pccab->szCab));
|
||||
return TRUE;
|
||||
}
|
||||
return FALSE;
|
||||
|
@ -507,7 +507,7 @@ summary_getproperty(msiobj* si, PyObject *args)
|
|||
PyErr_SetString(PyExc_NotImplementedError, "FILETIME result");
|
||||
return NULL;
|
||||
case VT_LPSTR:
|
||||
result = PyString_FromStringAndSize(sval, ssize);
|
||||
result = PyBytes_FromStringAndSize(sval, ssize);
|
||||
if (sval != sbuf)
|
||||
free(sval);
|
||||
return result;
|
||||
|
@ -539,9 +539,9 @@ summary_setproperty(msiobj* si, PyObject *args)
|
|||
if (!PyArg_ParseTuple(args, "iO:SetProperty", &field, &data))
|
||||
return NULL;
|
||||
|
||||
if (PyString_Check(data)) {
|
||||
if (PyBytes_Check(data)) {
|
||||
status = MsiSummaryInfoSetProperty(si->h, field, VT_LPSTR,
|
||||
0, NULL, PyString_AsString(data));
|
||||
0, NULL, PyBytes_AsString(data));
|
||||
} else if (PyLong_CheckExact(data)) {
|
||||
long value = PyLong_AsLong(data);
|
||||
if (value == -1 && PyErr_Occurred()) {
|
||||
|
|
|
@ -142,7 +142,7 @@ msvcrt_getch(PyObject *self, PyObject *args)
|
|||
ch = _getch();
|
||||
Py_END_ALLOW_THREADS
|
||||
s[0] = ch;
|
||||
return PyString_FromStringAndSize(s, 1);
|
||||
return PyBytes_FromStringAndSize(s, 1);
|
||||
}
|
||||
|
||||
#if _MSC_VER >= 1300
|
||||
|
@ -176,7 +176,7 @@ msvcrt_getche(PyObject *self, PyObject *args)
|
|||
ch = _getche();
|
||||
Py_END_ALLOW_THREADS
|
||||
s[0] = ch;
|
||||
return PyString_FromStringAndSize(s, 1);
|
||||
return PyBytes_FromStringAndSize(s, 1);
|
||||
}
|
||||
|
||||
#if _MSC_VER >= 1300
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue