X-Git-Url: https://git.notmuchmail.org/git?p=notmuch;a=blobdiff_plain;f=bindings%2Fpython%2Fnotmuch%2Fmessage.py;h=883ed233c7e170fbfcab9b58aca2676f31417920;hp=fe724a51302498c3684351fe8fbde6023c4b64cb;hb=bf6039e34eca52ccf7fe1db51e1b5c843a9828f3;hpb=ada246aa20c2f9b1e225bc50865e208d03296fc0 diff --git a/bindings/python/notmuch/message.py b/bindings/python/notmuch/message.py index fe724a51..883ed233 100644 --- a/bindings/python/notmuch/message.py +++ b/bindings/python/notmuch/message.py @@ -117,7 +117,7 @@ class Messages(object): :TODO: Make the iterator work more than once and cache the tags in the Python object.(?) """ - if msgs_p is None: + if not msgs_p: raise NotmuchError(STATUS.NULL_POINTER) self._msgs = msgs_p @@ -349,7 +349,7 @@ class Message(Python3StringMixIn): automatically delete the parent object once all derived objects are dead. """ - if msg_p is None: + if not msg_p: raise NotmuchError(STATUS.NULL_POINTER) self._msg = msg_p #keep reference to parent, so we keep it alive @@ -364,7 +364,7 @@ class Message(Python3StringMixIn): """ if self._msg is None: raise NotmuchError(STATUS.NOT_INITIALIZED) - return Message._get_message_id(self._msg).decode('utf-8', errors='ignore') + return Message._get_message_id(self._msg).decode('utf-8', 'ignore') def get_thread_id(self): """Returns the thread ID @@ -382,7 +382,7 @@ class Message(Python3StringMixIn): if self._msg is None: raise NotmuchError(STATUS.NOT_INITIALIZED) - return Message._get_thread_id(self._msg).decode('utf-8', errors='ignore') + return Message._get_thread_id(self._msg).decode('utf-8', 'ignore') def get_replies(self): """Gets all direct replies to this message as :class:`Messages` @@ -407,7 +407,7 @@ class Message(Python3StringMixIn): msgs_p = Message._get_replies(self._msg) - if msgs_p is None: + if not msgs_p: return EmptyMessagesResult(self) return Messages(msgs_p, self) @@ -454,7 +454,7 @@ class Message(Python3StringMixIn): header = Message._get_header(self._msg, _str(header)) if header == None: raise NotmuchError(STATUS.NULL_POINTER) - return header.decode('UTF-8', errors='ignore') + return header.decode('UTF-8', 'ignore') def get_filename(self): """Returns the file path of the message file @@ -465,7 +465,7 @@ class Message(Python3StringMixIn): """ if self._msg is None: raise NotmuchError(STATUS.NOT_INITIALIZED) - return Message._get_filename(self._msg).decode('utf-8', errors='ignore') + return Message._get_filename(self._msg).decode('utf-8', 'ignore') def get_filenames(self): """Get all filenames for the email corresponding to 'message'