tp_setattro() is supposed to return -1 on errors
authorPanu Matilainen <pmatilai@redhat.com>
Thu, 24 Sep 2009 10:04:34 +0000 (13:04 +0300)
committerPanu Matilainen <pmatilai@redhat.com>
Thu, 24 Sep 2009 10:04:34 +0000 (13:04 +0300)
python/rpmts-py.c

index 821d951..22aeb20 100644 (file)
@@ -997,7 +997,7 @@ static int rpmts_setattro(PyObject * o, PyObject * n, PyObject * v)
     int fdno;
 
     if (rstreq(name, "scriptFd")) {
-       if (!PyArg_Parse(v, "i", &fdno)) return 0;
+       if (!PyArg_Parse(v, "i", &fdno)) return -1;
        if (fdno < 0) {
            PyErr_SetString(PyExc_TypeError, "bad file descriptor");
            return -1;