Displaying 1 result from an estimated 1 matches for "ed299ff".
Did you mean:
0x299ff
2019 Nov 23
1
[PATCH] python: Support buffer protocol for pread() result
...count])
def pread(h, count, offset):
global disk
return memoryview(disk)[offset:offset+count]
plugins/python/python.c | 31 +++++++++++++++++++------------
1 file changed, 19 insertions(+), 12 deletions(-)
diff --git a/plugins/python/python.c b/plugins/python/python.c
index 148097f..ed299ff 100644
--- a/plugins/python/python.c
+++ b/plugins/python/python.c
@@ -445,10 +445,12 @@ py_pread (void *handle, void *buf,
PyObject *obj = handle;
PyObject *fn;
PyObject *r;
+ Py_buffer view = {0};
+ int ret = -1;
if (!callback_defined ("pread", &fn)) {
nbdkit_er...