From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from localhost (localhost [127.0.0.1]) by olra.theworths.org (Postfix) with ESMTP id 14DDD429E22 for ; Mon, 9 May 2011 00:06:40 -0700 (PDT) X-Virus-Scanned: Debian amavisd-new at olra.theworths.org X-Spam-Flag: NO X-Spam-Score: 0 X-Spam-Level: X-Spam-Status: No, score=0 tagged_above=-999 required=5 tests=[none] autolearn=disabled Received: from olra.theworths.org ([127.0.0.1]) by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id xjFmYMbyO4ve for ; Mon, 9 May 2011 00:06:39 -0700 (PDT) Received: from smtp1.kolej.mff.cuni.cz (smtp1.kolej.mff.cuni.cz [78.128.192.10]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by olra.theworths.org (Postfix) with ESMTPS id 4B1AE429E20 for ; Mon, 9 May 2011 00:06:39 -0700 (PDT) X-Envelope-From: anton@khirnov.net Received: from zohar.localdomain (zohar.kolej.mff.cuni.cz [78.128.198.199]) by smtp1.kolej.mff.cuni.cz (8.14.4/8.14.4) with ESMTP id p4976aTV075216 for ; Mon, 9 May 2011 09:06:37 +0200 (CEST) (envelope-from anton@khirnov.net) Received: by zohar.localdomain (Postfix, from userid 1000) id 699937F508; Mon, 9 May 2011 09:06:36 +0200 (CEST) From: Anton Khirnov 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 Message-Id: <1304924794-20380-1-git-send-email-anton@khirnov.net> X-Mailer: git-send-email 1.7.4.4 X-BeenThere: notmuch@notmuchmail.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: "Use and development of the notmuch mail system." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 May 2011 07:06:40 -0000 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