Transaction element parent is a transaction element, not an integer
authorPanu Matilainen <pmatilai@redhat.com>
Tue, 10 Jan 2012 08:38:31 +0000 (10:38 +0200)
committerPanu Matilainen <pmatilai@redhat.com>
Tue, 10 Jan 2012 08:38:31 +0000 (10:38 +0200)
- Ehm, this has been broken in the python bindings since the start,
  nobody noticed. Of course the parent value isn't particularly
  useful in normal usage but still...

python/rpmte-py.c

index f158247..2204a52 100644 (file)
@@ -114,7 +114,11 @@ rpmte_PkgFileSize(rpmteObject * s, PyObject * unused)
 static PyObject *
 rpmte_Parent(rpmteObject * s, PyObject * unused)
 {
-    return Py_BuildValue("i", rpmteParent(s->te));
+    rpmte parent = rpmteParent(s->te);
+    if (parent)
+       return rpmte_Wrap(&rpmte_Type, parent);
+
+    Py_RETURN_NONE;
 }
 
 static PyObject * rpmte_Failed(rpmteObject * s, PyObject * unused)