]> git.notmuchmail.org Git - notmuch/blobdiff - bindings/python/notmuch/message.py
python: add a file abstracting away differences between python 2 and 3
[notmuch] / bindings / python / notmuch / message.py
index 0cac09c1c133cee415cc62125b8262f6c0182e25..d7f029f8789d43faeca117e4febec70ede109506 100644 (file)
@@ -41,10 +41,6 @@ from .tag import Tags
 from .filenames import Filenames
 
 import email
-try:
-    import simplejson as json
-except ImportError:
-    import json
 
 
 class Message(Python3StringMixIn):
@@ -233,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')
 
@@ -304,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)