search for: c5cc4bd

Displaying 3 results from an estimated 3 matches for "c5cc4bd".

2018 Apr 06
6
[nbdkit PATCH 0/2] Python cleanups
I noticed these while working on adding fua support into python, these are independent enough to push now (and I'll have to rebase my 'optional may_trim' patch on top of this). Eric Blake (2): python: Use Py_XDEFREF() python: Simplify calling into plugin plugins/python/python.c | 106 ++++++++---------------------------------------- 1 file changed, 18 insertions(+), 88
2018 Apr 06
0
[nbdkit PATCH 1/2] python: Use Py_XDEFREF()
...to do a NULL check ourself, when we can just use the write Python wrapper. Signed-off-by: Eric Blake <eblake@redhat.com> --- plugins/python/python.c | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/plugins/python/python.c b/plugins/python/python.c index 35e8df2..c5cc4bd 100644 --- a/plugins/python/python.c +++ b/plugins/python/python.c @@ -183,8 +183,7 @@ py_load (void) static void py_unload (void) { - if (module) - Py_DECREF (module); + Py_XDECREF (module); Py_Finalize (); } @@ -346,8 +345,7 @@ py_close (void *handle) Py_DECREF (fn); Py_DEC...
2018 Apr 06
0
[nbdkit PATCH 2/2] python: Simplify calling into plugin
...trim' an optional callback parameter. Signed-off-by: Eric Blake <eblake@redhat.com> --- plugins/python/python.c | 97 ++++++++----------------------------------------- 1 file changed, 15 insertions(+), 82 deletions(-) diff --git a/plugins/python/python.c b/plugins/python/python.c index c5cc4bd..5ece97a 100644 --- a/plugins/python/python.c +++ b/plugins/python/python.c @@ -209,7 +209,6 @@ py_config (const char *key, const char *value) FILE *fp; PyObject *modname; PyObject *fn; - PyObject *args; PyObject *r; if (!script) { @@ -258,17 +257,8 @@ py_config (const char *key, c...