]> git.notmuchmail.org Git - notmuch/blobdiff - bindings/python/notmuch/messages.py
python: fix NULL pointer tests
[notmuch] / bindings / python / notmuch / messages.py
index 20d3632955bb3808c4e9c32edca14c28d73c0e4e..251fa3a3457f77ef42831925b7021264c4d9e3be 100644 (file)
@@ -14,18 +14,20 @@ for more details.
 You should have received a copy of the GNU General Public License
 along with notmuch.  If not, see <http://www.gnu.org/licenses/>.
 
-Copyright 2010 Sebastian Spaeth <Sebastian@SSpaeth.de>'
+Copyright 2010 Sebastian Spaeth <Sebastian@SSpaeth.de>
                Jesse Rosenthal <jrosenthal@jhu.edu>
 """
 
 from .globals import (
     nmlib,
-    NullPointerError,
-    NotInitializedError,
     NotmuchTagsP,
     NotmuchMessageP,
     NotmuchMessagesP,
 )
+from .errors import (
+    NullPointerError,
+    NotInitializedError,
+)
 from .tag import Tags
 from .message import Message
 
@@ -182,7 +184,7 @@ class Messages(object):
 
     def __del__(self):
         """Close and free the notmuch Messages"""
-        if self._msgs is not None:
+        if self._msgs:
             self._destroy(self._msgs)
 
     def format_messages(self, format, indent=0, entire_thread=False):