Relaxed type checking concerning boolean arguments in class constructors

and __call__ methods so that not only True and False but also various
other boolean expressions (e.g., 0, 1, and None) are accepted.
This commit is contained in:
Tamito Kajiyama
2009-04-03 20:03:09 +00:00
parent 5926ad2db2
commit acfd7c82ab
14 changed files with 82 additions and 34 deletions

View File

@@ -390,7 +390,7 @@ PyObject * StrokeAttribute_setThickness( BPy_StrokeAttribute *self, PyObject *ar
PyObject * StrokeAttribute_setVisible( BPy_StrokeAttribute *self, PyObject *args ) {
PyObject *py_b;
if(!( PyArg_ParseTuple(args, "O!", &PyBool_Type, &py_b) ))
if(!( PyArg_ParseTuple(args, "O", &py_b) ))
return NULL;
self->sa->setVisible( bool_from_PyBool(py_b) );