Commits

Alex Gaynor committed 15ace9b

checks

Comments (0)

Files changed (1)

c/_cffi_backend.c

         );
         return NULL;
     }
+    if (!PyCallable_Check(getter)) {
+        PyErr_Format(PyExc_TypeError, "getter must be callabe",
+            PyString_AS_STRING(name)
+        );
+        return NULL;
+    }
+    if (!PyCallable_Check(setter)) {
+        PyErr_Format(PyExc_TypeError, "setter must be callabe",
+            PyString_AS_STRING(name)
+        );
+        return NULL;
+    }
     PyObject *value = Py_BuildValue("OO", getter, setter);
     res = PyDict_SetItem(self->l_property_defines, name, value);
     if (res == -1)