Remove unnecessary header type checking
authorPanu Matilainen <pmatilai@redhat.com>
Wed, 23 Sep 2009 14:44:07 +0000 (17:44 +0300)
committerPanu Matilainen <pmatilai@redhat.com>
Wed, 23 Sep 2009 14:44:07 +0000 (17:44 +0300)
- the type is already validated by PyArg_ParseTupleAndKeywords(),
  no need to doublecheck

python/rpmts-py.c

index ab4f5b9..ed33ab3 100644 (file)
@@ -184,13 +184,6 @@ rpmts_AddInstall(rpmtsObject * s, PyObject * args, PyObject * kwds)
            &hdr_Type, &h, &key, &how))
        return NULL;
 
-    {  PyObject * hObj = (PyObject *) h;
-       if (hObj->ob_type != &hdr_Type) {
-           PyErr_SetString(PyExc_TypeError, "bad type for header argument");
-           return NULL;
-       }
-    }
-
     if (how && !rstreq(how, "u") && !rstreq(how, "i")) {
        PyErr_SetString(PyExc_TypeError, "how argument must be \"u\" or \"i\"");
        return NULL;