From: Anton Khirnov <anton@khirnov.net>
To: notmuch@notmuchmail.org
Subject: [PATCH] python/thread: always return a string in get_subject/authors
Date: Mon, 9 May 2011 09:06:34 +0200 [thread overview]
Message-ID: <1304924794-20380-1-git-send-email-anton@khirnov.net> (raw)
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
next reply other threads:[~2011-05-09 7:06 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-05-09 7:06 Anton Khirnov [this message]
2011-05-09 12:10 ` [PATCH] python/thread: always return a string in get_subject/authors Austin Clements
2011-05-09 12:20 ` David Bremner
2011-05-09 12:57 ` servilio
2011-05-09 15:13 ` Anton Khirnov
2011-05-09 15:23 ` Jesse Rosenthal
2011-05-09 15:26 ` Jesse Rosenthal
2011-05-10 1:00 ` Sebastian Spaeth
2011-05-10 1:18 ` Daniel Kahn Gillmor
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://notmuchmail.org/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1304924794-20380-1-git-send-email-anton@khirnov.net \
--to=anton@khirnov.net \
--cc=notmuch@notmuchmail.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://yhetil.org/notmuch.git/
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).