mirror of
https://git.notmuchmail.org/git/notmuch
synced 2024-11-25 12:28:09 +01:00
python: Fix the remaining broken NULL pointer tests
Signed-off-by: Justus Winter <4winter@informatik.uni-hamburg.de>
This commit is contained in:
parent
05c3e83bd2
commit
8dc8495010
4 changed files with 5 additions and 5 deletions
|
@ -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)
|
||||
|
||||
|
|
|
@ -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)
|
||||
|
||||
|
|
|
@ -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)
|
||||
|
||||
|
|
|
@ -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)
|
||||
|
||||
|
|
Loading…
Reference in a new issue