Improve type checking
authorJohan Dahlin <jdahlin@litl.com>
Thu, 19 Feb 2009 23:25:04 +0000 (20:25 -0300)
committerJohan Dahlin <johan@gnome.org>
Thu, 19 Feb 2009 23:25:04 +0000 (20:25 -0300)
giscanner/giscannermodule.c

index 26f28cb..3223508 100644 (file)
@@ -567,6 +567,8 @@ pygi_collect_attributes (PyObject *self,
   first = TRUE;
   attr_value = g_string_new ("");
 
+  g_assert(PyList_Check(attributes));
+  
   for (i = 0; i < PyList_Size (attributes); ++i)
     {
       PyObject *tuple;
@@ -574,6 +576,7 @@ pygi_collect_attributes (PyObject *self,
       
       tuple = PyList_GetItem (attributes, i);
       g_assert(tuple != NULL);
+      g_assert(PyTuple_Check(tuple));
       g_assert(PyTuple_Size(tuple) == 2);
       if (PyTuple_GetItem(tuple, 1) == Py_None)
        continue;