From 8dc8495010057202b725ac029831c03f4e3ab6bd Mon Sep 17 00:00:00 2001 From: Justus Winter <4winter@informatik.uni-hamburg.de> Date: Thu, 17 May 2012 17:15:24 +0200 Subject: [PATCH] python: Fix the remaining broken NULL pointer tests Signed-off-by: Justus Winter <4winter@informatik.uni-hamburg.de> --- bindings/python/notmuch/database.py | 2 +- bindings/python/notmuch/message.py | 4 ++-- bindings/python/notmuch/messages.py | 2 +- bindings/python/notmuch/thread.py | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) 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)