Browse Source

[1455] make find_all() always return a 3-tuple

Contrary to its documentation, in some cases only a 2-tuple was returned
Jelte Jansen 13 years ago
parent
commit
b31ea61475

+ 2 - 1
src/lib/python/isc/datasrc/finder_python.cc

@@ -147,7 +147,8 @@ PyObject* ZoneFinder_helper_all(ZoneFinder* finder, PyObject* args) {
                 // increases the refcount and the container decreases it
                 // later. This way, it feels safer in case the build function
                 // would fail.
-                return (Py_BuildValue("IO", r, list_container.get()));
+                return (Py_BuildValue("IOI", r, list_container.get(),
+                                      result_flags));
             } else {
                 if (rrsp) {
                     // Use N instead of O so the refcount isn't increased twice

+ 1 - 1
src/lib/python/isc/datasrc/tests/datasrc_test.py

@@ -83,7 +83,7 @@ def test_findall_common(self, tested):
 
     # A success. It should return the list now.
     # This also tests we can ommit the options parameter
-    result, rrsets = tested.find_all(isc.dns.Name("mix.example.com."))
+    result, rrsets, _ = tested.find_all(isc.dns.Name("mix.example.com."))
     self.assertEqual(ZoneFinder.SUCCESS, result)
     self.assertEqual(2, len(rrsets))
     rrsets.sort(key=lambda rrset: rrset.get_type().to_text())