mirror of
https://github.com/python/cpython.git
synced 2025-08-31 05:58:33 +00:00
Renamed PyString to PyBytes
This commit is contained in:
parent
9c4756ea26
commit
72b710a596
78 changed files with 983 additions and 983 deletions
|
@ -708,9 +708,9 @@ mmap_subscript(mmap_object *self, PyObject *item)
|
|||
}
|
||||
|
||||
if (slicelen <= 0)
|
||||
return PyString_FromStringAndSize("", 0);
|
||||
return PyBytes_FromStringAndSize("", 0);
|
||||
else if (step == 1)
|
||||
return PyString_FromStringAndSize(self->data + start,
|
||||
return PyBytes_FromStringAndSize(self->data + start,
|
||||
slicelen);
|
||||
else {
|
||||
char *result_buf = (char *)PyMem_Malloc(slicelen);
|
||||
|
@ -723,7 +723,7 @@ mmap_subscript(mmap_object *self, PyObject *item)
|
|||
cur += step, i++) {
|
||||
result_buf[i] = self->data[cur];
|
||||
}
|
||||
result = PyString_FromStringAndSize(result_buf,
|
||||
result = PyBytes_FromStringAndSize(result_buf,
|
||||
slicelen);
|
||||
PyMem_Free(result_buf);
|
||||
return result;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue