]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
[3.12] gh-122623: Improve `c-api/bytearray.rst` with error handling info (GH-122624...
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>
Sat, 3 Aug 2024 22:02:24 +0000 (00:02 +0200)
committerGitHub <noreply@github.com>
Sat, 3 Aug 2024 22:02:24 +0000 (22:02 +0000)
gh-122623: Improve `c-api/bytearray.rst` with error handling info (GH-122624)
(cherry picked from commit 151934a324789c58cca9c7bbd6753d735454df5a)

Co-authored-by: sobolevn <mail@sobolevn.me>
Doc/c-api/bytearray.rst

index 456f7d89bca03cd2df0f96d7c26c626f4fb95a59..9045689a6be56756c61f11b307058b469fcf5b1e 100644 (file)
@@ -42,17 +42,22 @@ Direct API functions
    Return a new bytearray object from any object, *o*, that implements the
    :ref:`buffer protocol <bufferobjects>`.
 
+   On failure, return ``NULL`` with an exception set.
+
 
 .. c:function:: PyObject* PyByteArray_FromStringAndSize(const char *string, Py_ssize_t len)
 
-   Create a new bytearray object from *string* and its length, *len*.  On
-   failure, ``NULL`` is returned.
+   Create a new bytearray object from *string* and its length, *len*.
+
+   On failure, return ``NULL`` with an exception set.
 
 
 .. c:function:: PyObject* PyByteArray_Concat(PyObject *a, PyObject *b)
 
    Concat bytearrays *a* and *b* and return a new bytearray with the result.
 
+   On failure, return ``NULL`` with an exception set.
+
 
 .. c:function:: Py_ssize_t PyByteArray_Size(PyObject *bytearray)