From ba11b2d684b9bc44cb3ba2608979a6b9a8a4a331 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rodolfo=20Garc=C3=ADa=20Pe=C3=B1as=20=28kix=29?= Date: Thu, 3 Sep 2020 20:42:30 +0200 Subject: [PATCH] six: changed offlineimap/folder/Maildir.py MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This patch removes the library six, compatible with python2. I need change these re-raise calls. Signed-off-by: Rodolfo García Peñas (kix) --- offlineimap/folder/Maildir.py | 33 +++++++++++++++------------------ 1 file changed, 15 insertions(+), 18 deletions(-) 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")