From: Justus Winter <4winter@informatik.uni-hamburg.de> Date: Thu, 17 May 2012 15:15:24 +0000 (+0200) Subject: python: Fix the remaining broken NULL pointer tests X-Git-Tag: 0.14~127 X-Git-Url: https://git.notmuchmail.org/git?p=notmuch;a=commitdiff_plain;h=8dc8495010057202b725ac029831c03f4e3ab6bd python: Fix the remaining broken NULL pointer tests Signed-off-by: Justus Winter <4winter@informatik.uni-hamburg.de> --- diff --git a/bindings/python/notmuch/database.py b/bindings/python/notmuch/database.py index fb4c9293..8f1b37f7 100644 --- a/bindings/python/notmuch/database.py +++ b/bindings/python/notmuch/database.py @@ -558,7 +558,7 @@ class Database(object): """ self._assert_db_is_initialized() tags_p = Database._get_all_tags(self._db) - if tags_p == None: + if not tags_p: raise NullPointerError() return Tags(tags_p, self) diff --git a/bindings/python/notmuch/message.py b/bindings/python/notmuch/message.py index bdbe5012..d7f029f8 100644 --- a/bindings/python/notmuch/message.py +++ b/bindings/python/notmuch/message.py @@ -229,7 +229,7 @@ class Message(Python3StringMixIn): #Returns NULL if any error occurs. header = Message._get_header(self._msg, _str(header)) - if header == None: + if not header: raise NullPointerError() return header.decode('UTF-8', 'ignore') @@ -300,7 +300,7 @@ class Message(Python3StringMixIn): raise NotInitializedError() tags_p = Message._get_tags(self._msg) - if tags_p == None: + if not tags_p: raise NullPointerError() return Tags(tags_p, self) diff --git a/bindings/python/notmuch/messages.py b/bindings/python/notmuch/messages.py index 59ef40af..aee4a773 100644 --- a/bindings/python/notmuch/messages.py +++ b/bindings/python/notmuch/messages.py @@ -142,7 +142,7 @@ class Messages(object): #reset _msgs as we iterated over it and can do so only once self._msgs = None - if tags_p == None: + if not tags_p: raise NullPointerError() return Tags(tags_p, self) diff --git a/bindings/python/notmuch/thread.py b/bindings/python/notmuch/thread.py index 789f9a04..009cb2bf 100644 --- a/bindings/python/notmuch/thread.py +++ b/bindings/python/notmuch/thread.py @@ -238,7 +238,7 @@ class Thread(object): raise NotInitializedError() tags_p = Thread._get_tags(self._thread) - if tags_p == None: + if not tags_p: raise NullPointerError() return Tags(tags_p, self)