8000 [3.12] gh-122623: Improve `c-api/bytearray.rst` with error handling i… · python/cpython@62f224a · GitHub
[go: up one dir, main page]

Skip to content

Commit 62f224a

Browse files
[3.12] gh-122623: Improve c-api/bytearray.rst with error handling info (GH-122624) (#122659)
gh-122623: Improve `c-api/bytearray.rst` with error handling info (GH-122624) (cherry picked from commit 151934a) Co-authored-by: sobolevn <mail@sobolevn.me>
1 parent 8f1b385 commit 62f224a

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

Doc/c-api/bytearray.rst

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,17 +42,22 @@ Direct API functions
4242
Return a new bytearray object from any object, *o*, that implements the
4343
:ref:`buffer protocol <bufferobjects>`.
4444
45+
On failure, return ``NULL`` with an exception set.
46+
4547
4648
.. c:function:: PyObject* PyByteArray_FromStringAndSize(const char *string, Py_ssize_t len)
4749
48-
Create a new bytearray object from *string* and its length, *len*. On
49-
failure, ``NULL`` is returned.
50+
Create a new bytearray object from *string* and its length, *len*.
51+
52+
On failure, return ``NULL`` with an exception set.
5053
5154
5255
.. c:function:: PyObject* PyByteArray_Concat(PyObject *a, PyObject *b)
5356
5457
Concat bytearrays *a* and *b* and return a new bytearray with the result.
5558
59+
On failure, return ``NULL`` with an exception set.
60+
5661
5762
.. c:function:: Py_ssize_t PyByteArray_Size(PyObject *bytearray)
5863

0 commit comments

Comments
 (0)
0