Call generic python setattr if not scriptFd
authorPanu Matilainen <pmatilai@redhat.com>
Thu, 24 Sep 2009 10:05:36 +0000 (13:05 +0300)
committerPanu Matilainen <pmatilai@redhat.com>
Thu, 24 Sep 2009 10:05:36 +0000 (13:05 +0300)
- yet more preliminaries for subtyping

python/rpmts-py.c

index 22aeb20..348e2e8 100644 (file)
@@ -996,6 +996,7 @@ static int rpmts_setattro(PyObject * o, PyObject * n, PyObject * v)
     char * name = PyString_AsString(n);
     int fdno;
 
+    /* XXX TODO: eliminate this hackery */
     if (rstreq(name, "scriptFd")) {
        if (!PyArg_Parse(v, "i", &fdno)) return -1;
        if (fdno < 0) {
@@ -1006,8 +1007,7 @@ static int rpmts_setattro(PyObject * o, PyObject * n, PyObject * v)
            rpmtsSetScriptFd(s->ts, s->scriptFd);
        }
     } else {
-       PyErr_SetString(PyExc_AttributeError, name);
-       return -1;
+       return PyObject_GenericSetAttr(o, n, v);
     }
 
     return 0;