gh-121645: Add PyBytes_Join() function (#121646)

* Replace _PyBytes_Join() with PyBytes_Join().
* Keep _PyBytes_Join() as an alias to PyBytes_Join().
This commit is contained in:
Victor Stinner 2024-08-30 14:57:33 +02:00 committed by GitHub
parent 7fca268bee
commit 3d60dfbe17
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
10 changed files with 101 additions and 12 deletions

View file

@ -1283,7 +1283,7 @@ found:
Py_CLEAR(res);
goto end;
}
Py_XSETREF(res, _PyBytes_Join((PyObject *)&_Py_SINGLETON(bytes_empty), chunks));
Py_XSETREF(res, PyBytes_Join((PyObject *)&_Py_SINGLETON(bytes_empty), chunks));
end:
LEAVE_BUFFERED(self)
@ -1736,7 +1736,7 @@ _bufferedreader_read_all(buffered *self)
goto cleanup;
}
else {
tmp = _PyBytes_Join((PyObject *)&_Py_SINGLETON(bytes_empty), chunks);
tmp = PyBytes_Join((PyObject *)&_Py_SINGLETON(bytes_empty), chunks);
res = tmp;
goto cleanup;
}

View file

@ -999,7 +999,7 @@ _io__RawIOBase_readall_impl(PyObject *self)
return NULL;
}
}
result = _PyBytes_Join((PyObject *)&_Py_SINGLETON(bytes_empty), chunks);
result = PyBytes_Join((PyObject *)&_Py_SINGLETON(bytes_empty), chunks);
Py_DECREF(chunks);
return result;
}