python: Fix the remaining broken NULL pointer tests

Signed-off-by: Justus Winter <4winter@informatik.uni-hamburg.de>
This commit is contained in:
Justus Winter 2012-05-17 17:15:24 +02:00
parent 05c3e83bd2
commit 8dc8495010
4 changed files with 5 additions and 5 deletions

View file

@ -558,7 +558,7 @@ class Database(object):
""" """
self._assert_db_is_initialized() self._assert_db_is_initialized()
tags_p = Database._get_all_tags(self._db) tags_p = Database._get_all_tags(self._db)
if tags_p == None: if not tags_p:
raise NullPointerError() raise NullPointerError()
return Tags(tags_p, self) return Tags(tags_p, self)

View file

@ -229,7 +229,7 @@ class Message(Python3StringMixIn):
#Returns NULL if any error occurs. #Returns NULL if any error occurs.
header = Message._get_header(self._msg, _str(header)) header = Message._get_header(self._msg, _str(header))
if header == None: if not header:
raise NullPointerError() raise NullPointerError()
return header.decode('UTF-8', 'ignore') return header.decode('UTF-8', 'ignore')
@ -300,7 +300,7 @@ class Message(Python3StringMixIn):
raise NotInitializedError() raise NotInitializedError()
tags_p = Message._get_tags(self._msg) tags_p = Message._get_tags(self._msg)
if tags_p == None: if not tags_p:
raise NullPointerError() raise NullPointerError()
return Tags(tags_p, self) return Tags(tags_p, self)

View file

@ -142,7 +142,7 @@ class Messages(object):
#reset _msgs as we iterated over it and can do so only once #reset _msgs as we iterated over it and can do so only once
self._msgs = None self._msgs = None
if tags_p == None: if not tags_p:
raise NullPointerError() raise NullPointerError()
return Tags(tags_p, self) return Tags(tags_p, self)

View file

@ -238,7 +238,7 @@ class Thread(object):
raise NotInitializedError() raise NotInitializedError()
tags_p = Thread._get_tags(self._thread) tags_p = Thread._get_tags(self._thread)
if tags_p == None: if not tags_p:
raise NullPointerError() raise NullPointerError()
return Tags(tags_p, self) return Tags(tags_p, self)