Displaying 1 result from an estimated 1 matches for "pyexc_indexerror".
Did you mean:
_pyexc_indexerror
2020 Jan 30
2
[PATCH libnbd] python: Add AIO buffer is_zero method.
...&obj, &offset, &size))
+ return NULL;
+
+ if (size == 0)
+ Py_RETURN_TRUE;
+
+ buf = nbd_internal_py_get_aio_buffer (obj);
+ if (buf == NULL)
+ return NULL;
+
+ /* Check the bounds of the offset. */
+ if (offset < 0 || offset > buf->len) {
+ PyErr_SetString (PyExc_IndexError, "offset out of range");
+ return NULL;
+ }
+
+ /* Compute or check the length. */
+ if (size == -1)
+ size = buf->len - offset;
+ else if (size < 0) {
+ PyErr_SetString (PyExc_IndexError,
+ "size cannot be negative, "
+...