]> git.notmuchmail.org Git - notmuch/blobdiff - bindings/python/notmuch/message.py
python: fix NULL pointer tests
[notmuch] / bindings / python / notmuch / message.py
index d17b9bc693c2a4ce6f8e87ef2a955219668cc459..4ec5147b55115bc2db1a2b26339bcb019e0ee99c 100644 (file)
@@ -14,7 +14,7 @@ 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>
 """
 
@@ -26,15 +26,17 @@ from .globals import (
     Enum,
     _str,
     Python3StringMixIn,
-    STATUS,
-    NotmuchError,
-    NullPointerError,
-    NotInitializedError,
     NotmuchTagsP,
     NotmuchMessageP,
     NotmuchMessagesP,
     NotmuchFilenamesP,
 )
+from .errors import (
+    STATUS,
+    NotmuchError,
+    NullPointerError,
+    NotInitializedError,
+)
 from .tag import Tags
 from .filenames import Filenames
 
@@ -257,7 +259,7 @@ class Message(Python3StringMixIn):
 
         files_p = Message._get_filenames(self._msg)
 
-        return Filenames(files_p, self).as_generator()
+        return Filenames(files_p, self)
 
     def get_flag(self, flag):
         """Checks whether a specific flag is set for this message
@@ -739,5 +741,5 @@ class Message(Python3StringMixIn):
 
     def __del__(self):
         """Close and free the notmuch Message"""
-        if self._msg is not None:
+        if self._msg:
             self._destroy(self._msg)