aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJustus Winter <4winter@informatik.uni-hamburg.de>2011-09-25 23:07:35 +0200
committerSebastian Spaeth <Sebastian@SSpaeth.de>2011-09-29 09:48:06 +0200
commit19daa117b90289d724392e04e3647ade6db4dd7b (patch)
treed5d8bd59a3571e211cad9f976f59245dc26bf6e8
parent34990908e75f73061753a7f38201a05247a207a1 (diff)
properly raise exceptions in python bindings
There are various locations where exceptions are constructed but not raised. This patch adds the necessary raise statements. Signed-off-by: Justus Winter <4winter@informatik.uni-hamburg.de>
-rw-r--r--bindings/python/notmuch/database.py4
-rw-r--r--bindings/python/notmuch/filename.py2
-rw-r--r--bindings/python/notmuch/message.py4
-rw-r--r--bindings/python/notmuch/tag.py2
-rw-r--r--bindings/python/notmuch/thread.py6
5 files changed, 9 insertions, 9 deletions
diff --git a/bindings/python/notmuch/database.py b/bindings/python/notmuch/database.py
index 9fb30e63..e18381ba 100644
--- a/bindings/python/notmuch/database.py
+++ b/bindings/python/notmuch/database.py
@@ -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)
diff --git a/bindings/python/notmuch/filename.py b/bindings/python/notmuch/filename.py
index 630886d7..a16e717e 100644
--- a/bindings/python/notmuch/filename.py
+++ b/bindings/python/notmuch/filename.py
@@ -68,7 +68,7 @@ class Filenames(object):
once all derived objects are dead.
"""
if files_p is None:
- NotmuchError(STATUS.NULL_POINTER)
+ raise NotmuchError(STATUS.NULL_POINTER)
self._files = files_p
#save reference to parent object so we keep it alive
diff --git a/bindings/python/notmuch/message.py b/bindings/python/notmuch/message.py
index e5f60621..0c3365b5 100644
--- a/bindings/python/notmuch/message.py
+++ b/bindings/python/notmuch/message.py
@@ -115,7 +115,7 @@ class Messages(object):
the Python object.(?)
"""
if msgs_p is None:
- NotmuchError(STATUS.NULL_POINTER)
+ raise NotmuchError(STATUS.NULL_POINTER)
self._msgs = msgs_p
#store parent, so we keep them alive as long as self is alive
@@ -290,7 +290,7 @@ class Message(object):
objects are dead.
"""
if msg_p is None:
- NotmuchError(STATUS.NULL_POINTER)
+ raise NotmuchError(STATUS.NULL_POINTER)
self._msg = msg_p
#keep reference to parent, so we keep it alive
self._parent = parent
diff --git a/bindings/python/notmuch/tag.py b/bindings/python/notmuch/tag.py
index 0f25b0f7..50e3686b 100644
--- a/bindings/python/notmuch/tag.py
+++ b/bindings/python/notmuch/tag.py
@@ -70,7 +70,7 @@ class Tags(object):
cache the tags in the Python object(?)
"""
if tags_p is None:
- NotmuchError(STATUS.NULL_POINTER)
+ raise NotmuchError(STATUS.NULL_POINTER)
self._tags = tags_p
#save reference to parent object so we keep it alive
diff --git a/bindings/python/notmuch/thread.py b/bindings/python/notmuch/thread.py
index 83b4202d..5e08eb31 100644
--- a/bindings/python/notmuch/thread.py
+++ b/bindings/python/notmuch/thread.py
@@ -95,7 +95,7 @@ class Threads(object):
the Python object.(?)
"""
if threads_p is None:
- NotmuchError(STATUS.NULL_POINTER)
+ raise NotmuchError(STATUS.NULL_POINTER)
self._threads = threads_p
#store parent, so we keep them alive as long as self is alive
@@ -206,7 +206,7 @@ class Thread(object):
objects are dead.
"""
if thread_p is None:
- NotmuchError(STATUS.NULL_POINTER)
+ raise NotmuchError(STATUS.NULL_POINTER)
self._thread = thread_p
#keep reference to parent, so we keep it alive
self._parent = parent
@@ -263,7 +263,7 @@ class Thread(object):
msgs_p = Thread._get_toplevel_messages(self._thread)
if msgs_p is None:
- NotmuchError(STATUS.NULL_POINTER)
+ raise NotmuchError(STATUS.NULL_POINTER)
return Messages(msgs_p, self)