From 79a59bc94469a5d25f30852b0293902a277f963c Mon Sep 17 00:00:00 2001
From: Manuel Guenther <manuel.guenther@idiap.ch>
Date: Thu, 25 Sep 2014 16:14:33 +0200
Subject: [PATCH] Made HDF5File.sub_groups parameters optional (as they should
 be).

---
 bob/io/base/hdf5.cpp | 8 +++-----
 1 file changed, 3 insertions(+), 5 deletions(-)

diff --git a/bob/io/base/hdf5.cpp b/bob/io/base/hdf5.cpp
index 47cb773..d2dbcc7 100644
--- a/bob/io/base/hdf5.cpp
+++ b/bob/io/base/hdf5.cpp
@@ -769,12 +769,10 @@ static PyObject* PyBobIoHDF5File_SubGroups(PyBobIoHDF5FileObject* self, PyObject
 
   PyObject* pyrel = 0;
   PyObject* pyrec = 0;
-  if (!PyArg_ParseTupleAndKeywords(args, kwds, "OO", kwlist, &pyrel, &pyrec)) return 0;
+  if (!PyArg_ParseTupleAndKeywords(args, kwds, "|OO", kwlist, &pyrel, &pyrec)) return 0;
 
-  bool relative = false;
-  if (pyrel && PyObject_IsTrue(pyrel)) relative = true;
-  bool recursive = true;
-  if (pyrec && !PyObject_IsTrue(pyrec)) recursive = false;
+  bool relative = (pyrel && PyObject_IsTrue(pyrel));
+  bool recursive = (!pyrec || PyObject_IsTrue(pyrec));
 
   PyObject* retval = 0;
 
-- 
GitLab