summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTavian Barnes <tavianator@gmail.com>2011-05-20 13:21:07 -0600
committerTavian Barnes <tavianator@gmail.com>2011-05-20 13:21:07 -0600
commit5770d22635a63fb745bc0f3cd3dee573a6b356b6 (patch)
tree9419c0e5db1ed5eedce08f2fbaf519337c6997d5
parent387c1b8b1fcf80233d3fc73aa3be766bfea83dc8 (diff)
downloaddimension-5770d22635a63fb745bc0f3cd3dee573a6b356b6.tar.xz
Properly handle bools in dieOnWarnings().
-rw-r--r--libdimension-python/dimension.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/libdimension-python/dimension.c b/libdimension-python/dimension.c
index e57767d..f47dfbc 100644
--- a/libdimension-python/dimension.c
+++ b/libdimension-python/dimension.c
@@ -27,11 +27,15 @@
static PyObject *
dmnsn_py_dieOnWarnings(PyObject *self, PyObject *args)
{
- int die;
- if (!PyArg_ParseTuple(args, "i", &die))
+ PyObject *obj;
+ if (!PyArg_ParseTuple(args, "O", &obj))
return NULL;
- dmnsn_die_on_warnings(die);
+ int istrue = PyObject_IsTrue(obj);
+ if (istrue == -1)
+ return NULL;
+
+ dmnsn_die_on_warnings(istrue);
Py_INCREF(Py_None);
return Py_None;