diff options
Diffstat (limited to 'include')
-rw-r--r-- | include/snakeoil/common.h | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/include/snakeoil/common.h b/include/snakeoil/common.h index 259d84d..8040b2f 100644 --- a/include/snakeoil/common.h +++ b/include/snakeoil/common.h @@ -29,7 +29,13 @@ snakeoil_ATTR_GET_BOOL(type, name, attr, get_test) static int \ type##_set_##attr (type *self, PyObject *v, void *closure) \ { \ - int tmp = PyObject_IsTrue(value); \ + int tmp; \ + if(!value) \ + PyErr_SetString(PyExc_TypeError, \ + "Cannot delete the "name" attribute") \ + return -1; \ + } \ + = PyObject_IsTrue(value); \ if (tmp == -1) \ return -1; \ if(tmp) { \ |