summaryrefslogtreecommitdiffstats
path: root/libmount/python
diff options
context:
space:
mode:
Diffstat (limited to 'libmount/python')
-rw-r--r--libmount/python/pylibmount.c3
-rw-r--r--libmount/python/tab.c3
2 files changed, 4 insertions, 2 deletions
diff --git a/libmount/python/pylibmount.c b/libmount/python/pylibmount.c
index 1403bfe3c..c538bb543 100644
--- a/libmount/python/pylibmount.c
+++ b/libmount/python/pylibmount.c
@@ -90,6 +90,7 @@ PyObject *PyObjectResultInt(int i)
PyObject *PyObjectResultStr(const char *s)
{
+ PyObject *result;
if (!s)
/* TODO: maybe lie about it and return "":
* which would allow for
@@ -97,7 +98,7 @@ PyObject *PyObjectResultStr(const char *s)
* fs.comment += "comment"
return Py_BuildValue("s", ""); */
Py_RETURN_NONE;
- PyObject *result = Py_BuildValue("s", s);
+ result = Py_BuildValue("s", s);
if (!result)
PyErr_SetString(PyExc_RuntimeError, CONSTRUCT_ERR);
return result;
diff --git a/libmount/python/tab.c b/libmount/python/tab.c
index 9ea6924c0..6f255aef7 100644
--- a/libmount/python/tab.c
+++ b/libmount/python/tab.c
@@ -600,9 +600,10 @@ static int Table_init(TableObject *self, PyObject *args, PyObject *kwds)
self->iter = mnt_new_iter(MNT_ITER_FORWARD);
if (errcb) {
+ PyObject *tmp;
if (!PyCallable_Check(errcb))
return -1;
- PyObject *tmp = self->errcb;
+ tmp = self->errcb;
Py_INCREF(errcb);
self->errcb = errcb;
Py_XDECREF(tmp);