diff --git a/Doc/c-api/bytes.rst b/Doc/c-api/bytes.rst index 82c2557368371f..b3cd26a8504715 100644 --- a/Doc/c-api/bytes.rst +++ b/Doc/c-api/bytes.rst @@ -371,6 +371,8 @@ Getters Get the writer size. + The function cannot fail. + .. c:function:: void* PyBytesWriter_GetData(PyBytesWriter *writer) Get the writer data: start of the internal buffer. @@ -378,6 +380,8 @@ Getters The pointer is valid until :c:func:`PyBytesWriter_Finish` or :c:func:`PyBytesWriter_Discard` is called on *writer*. + The function cannot fail. + Low-level API ^^^^^^^^^^^^^ diff --git a/Modules/binascii.c b/Modules/binascii.c index 3f3695d50f2754..c076b12fb149b2 100644 --- a/Modules/binascii.c +++ b/Modules/binascii.c @@ -923,9 +923,6 @@ binascii_a2b_ascii85_impl(PyObject *module, Py_buffer *data, int foldspaces, return NULL; } unsigned char *bin_data = PyBytesWriter_GetData(writer); - if (bin_data == NULL) { - goto error; - } uint32_t leftchar = 0; int group_pos = 0;