char *dest;
if (slicelen <= 0)
- return PyBytes_FromStringAndSize("", 0);
+ return Py_GetConstant(Py_CONSTANT_EMPTY_BYTES);
if (step == 1) {
return PyBytes_FromStringAndSize(ptr + start,
slicelen);
char *dest;
if (len <= 0)
- return PyBytes_FromStringAndSize("", 0);
+ return Py_GetConstant(Py_CONSTANT_EMPTY_BYTES);
if (step == 1) {
return PyBytes_FromStringAndSize(ptr + start,
len);
Py_DECREF(state);
}
else {
- buffer = PyBytes_FromString("");
+ buffer = Py_GetConstant(Py_CONSTANT_EMPTY_BYTES);
flag = 0;
}
flag <<= 1;
remaining = (self->pos < self->size) ? self->size - self->pos : 0;
if (!remaining)
- return PyBytes_FromString("");
+ return Py_GetConstant(Py_CONSTANT_EMPTY_BYTES);
start = self->data + self->pos;
if (safe_memchr(&eol, start, '\n', remaining) < 0) {
CHECK_VALID(NULL);
if (slicelen <= 0)
- return PyBytes_FromStringAndSize("", 0);
+ return Py_GetConstant(Py_CONSTANT_EMPTY_BYTES);
else if (step == 1)
return _safe_PyBytes_FromStringAndSize(self->data + start, slicelen);
else {
self->eof = 0;
self->is_initialised = 0;
self->zdict = NULL;
- self->unused_data = PyBytes_FromStringAndSize("", 0);
+ self->unused_data = Py_GetConstant(Py_CONSTANT_EMPTY_BYTES);
if (self->unused_data == NULL) {
Py_DECREF(self);
return NULL;
}
- self->unconsumed_tail = PyBytes_FromStringAndSize("", 0);
+ self->unconsumed_tail = Py_GetConstant(Py_CONSTANT_EMPTY_BYTES);
if (self->unconsumed_tail == NULL) {
Py_DECREF(self);
return NULL;
&stop, step);
if (slicelength <= 0) {
- return PyBytes_FromStringAndSize("", 0);
+ return Py_GetConstant(Py_CONSTANT_EMPTY_BYTES);
}
else if (start == 0 && step == 1 &&
slicelength == PyBytes_GET_SIZE(self) &&
}
if (bytes_found) {
- PyObject* res = PyBytes_FromString("");
+ PyObject* res = Py_GetConstant(Py_CONSTANT_EMPTY_BYTES);
/* Bytes literals never get a kind, but just for consistency
since they are represented as Constant nodes, we'll mirror