]> git.cworth.org Git - obsolete/notmuch-old/blobdiff - bindings/python/notmuch/globals.py
python: fix NotmuchError.__str__ if status == None
[obsolete/notmuch-old] / bindings / python / notmuch / globals.py
index 2a57c411f3b6c4a07f61ec069c59397efe928059..097ab96800d1dcaa3336f037605be61561b1d0fd 100644 (file)
@@ -99,8 +99,10 @@ class NotmuchError(Exception):
     def __str__(self):
         if self.message is not None:
             return self.message
-        else:
+        elif self.status is not None:
             return STATUS.status2str(self.status)
+        else:
+            return 'Unknown error'
 
 def _str(value):
     """Ensure a nicely utf-8 encoded string to pass to libnotmuch