]> git.notmuchmail.org Git - notmuch/commitdiff
python: Fix the remaining broken NULL pointer tests
authorJustus Winter <4winter@informatik.uni-hamburg.de>
Thu, 17 May 2012 15:15:24 +0000 (17:15 +0200)
committerJustus Winter <4winter@informatik.uni-hamburg.de>
Thu, 17 May 2012 15:15:49 +0000 (17:15 +0200)
Signed-off-by: Justus Winter <4winter@informatik.uni-hamburg.de>
bindings/python/notmuch/database.py
bindings/python/notmuch/message.py
bindings/python/notmuch/messages.py
bindings/python/notmuch/thread.py

index fb4c92931a36eaf7d19cd13143ea9409fc5a4776..8f1b37f7b61a7c76dec5bae1800b2b64f482746e 100644 (file)
@@ -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)
 
index bdbe5012bd0f175eb69fc36603722198a4fa72b6..d7f029f8789d43faeca117e4febec70ede109506 100644 (file)
@@ -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)
 
index 59ef40afee1ea2103f8273492c57b5debb4c9479..aee4a773b5666253b2b33fe4eed6d62529d64f06 100644 (file)
@@ -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)
 
index 789f9a0467d5f768524a0eff9b862356355d046d..009cb2bfb34c29e77f31d011bf596df593485032 100644 (file)
@@ -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)