diff --git a/offlineimap/folder/Maildir.py b/offlineimap/folder/Maildir.py index 9783069..1d2a2eb 100644 --- a/offlineimap/folder/Maildir.py +++ b/offlineimap/folder/Maildir.py @@ -21,7 +21,6 @@ import re import os from sys import exc_info from threading import Lock -import six try: from hashlib import md5 @@ -319,11 +318,10 @@ class MaildirFolder(BaseFolder): time.sleep(0.23) continue severity = OfflineImapError.ERROR.MESSAGE - six.reraise(OfflineImapError, - OfflineImapError( - "Unique filename %s already exists." % - filename, severity), - exc_info()[2]) + raise OfflineImapError( + "Unique filename %s already exists." % + filename, severity, + exc_info()[2]) else: raise @@ -442,12 +440,11 @@ class MaildirFolder(BaseFolder): os.rename(os.path.join(self.getfullname(), oldfilename), os.path.join(self.getfullname(), newfilename)) except OSError as e: - six.reraise(OfflineImapError, - OfflineImapError( - "Can't rename file '%s' to '%s': %s" % - (oldfilename, newfilename, e[1]), - OfflineImapError.ERROR.FOLDER), - exc_info()[2]) + raise OfflineImapError( + "Can't rename file '%s' to '%s': %s" % + (oldfilename, newfilename, e[1]), + OfflineImapError.ERROR.FOLDER, + exc_info()[2]) self.messagelist[uid]['flags'] = flags self.messagelist[uid]['filename'] = newfilename @@ -529,12 +526,12 @@ class MaildirFolder(BaseFolder): try: os.rename(filename, newfilename) except OSError as e: - six.reraise(OfflineImapError, - OfflineImapError( - "Can't rename file '%s' to '%s': %s" % - (filename, newfilename, e[1]), - OfflineImapError.ERROR.FOLDER), - exc_info()[2]) + raise OfflineImapError( + "Can't rename file '%s' to '%s': %s" % + (filename, newfilename, e[1]), + OfflineImapError.ERROR.FOLDER, + exc_info()[2]) + elif match.group(1) != self._foldermd5: self.ui.warn(("Inconsistent FMD5 for file `%s':" " Neither `%s' nor `%s' found")