[PATCH] python/thread: always return a string in get_subject/authors

Subject: [PATCH] python/thread: always return a string in get_subject/authors

Date: Mon, 9 May 2011 09:06:34 +0200

To: notmuch@notmuchmail.org

Cc:

From: Anton Khirnov


Now None is returned when those don't exist, which is inconvenient to
deal with.
---
 bindings/python/notmuch/thread.py |    6 ++++--
 1 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/bindings/python/notmuch/thread.py b/bindings/python/notmuch/thread.py
index eebd6cb..cf26957 100644
--- a/bindings/python/notmuch/thread.py
+++ b/bindings/python/notmuch/thread.py
@@ -281,7 +281,8 @@ class Thread(object):
         """
         if self._thread is None:
             raise NotmuchError(STATUS.NOT_INITIALIZED)
-        return Thread._get_authors(self._thread)
+        ret = Thread._get_authors(self._thread)
+        return ret if ret else ''
 
     def get_subject(self):
         """Returns the Subject of 'thread'
@@ -291,7 +292,8 @@ class Thread(object):
         """
         if self._thread is None:
             raise NotmuchError(STATUS.NOT_INITIALIZED)
-        return Thread._get_subject(self._thread)
+        ret = Thread._get_subject(self._thread)
+        return ret if ret else ''
 
     def get_newest_date(self):
         """Returns time_t of the newest message date
-- 
1.7.4.4


Thread: