]> git.notmuchmail.org Git - notmuch/blobdiff - bindings/python/notmuch/database.py
properly raise exceptions in python bindings
[notmuch] / bindings / python / notmuch / database.py
index 9fb30e6355d2ca9bca4d90311d2862e9455cb771..e18381ba3bab25368cb1a009700dd94c93973290 100644 (file)
@@ -569,7 +569,7 @@ class Query(object):
         # create query, return None if too little mem available
         query_p = Query._create(db.db_p, _str(querystr))
         if query_p is None:
-            NotmuchError(STATUS.NULL_POINTER)
+            raise NotmuchError(STATUS.NULL_POINTER)
         self._query = query_p
 
     def set_sort(self, sort):
@@ -637,7 +637,7 @@ class Query(object):
         msgs_p = Query._search_messages(self._query)
 
         if msgs_p is None:
-            NotmuchError(STATUS.NULL_POINTER)
+            raise NotmuchError(STATUS.NULL_POINTER)
 
         return Messages(msgs_p, self)