From b8137a802822ab9473151b7434edf85a6687c390 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:06:15 +0200 Subject: [PATCH] six: changed offlineimap/accounts.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/accounts.py | 23 ++++++++++------------- 1 file changed, 10 insertions(+), 13 deletions(-) diff --git a/offlineimap/accounts.py b/offlineimap/accounts.py index 6a7d867..14ce6f3 100644 --- a/offlineimap/accounts.py +++ b/offlineimap/accounts.py @@ -20,7 +20,6 @@ import os import time from sys import exc_info import traceback -import six from offlineimap import mbnames, CustomConfig, OfflineImapError from offlineimap import globals @@ -245,12 +244,11 @@ class SyncableAccount(Account): pass # fnctl not available, disable file locking... :( except IOError: self._lockfd.close() - six.reraise(OfflineImapError, - OfflineImapError( - "Could not lock account %s. Is another " - "instance using this account?" % self, - OfflineImapError.ERROR.REPO), - exc_info()[2]) + raise OfflineImapError( + "Could not lock account %s. Is another " + "instance using this account?" % self, + OfflineImapError.ERROR.REPO, + exc_info()[2]) def _unlock(self): """Unlock the account, deleting the lock file""" @@ -614,12 +612,11 @@ def syncfolder(account, remotefolder, quick): localstart = localfolder.getstartdate() remotestart = remotefolder.getstartdate() if (maxage is not None) + (localstart is not None) + (remotestart is not None) > 1: - six.reraise(OfflineImapError, - OfflineImapError("You can set at most one of the " - "following: maxage, startdate (for the local " - "folder), startdate (for the remote folder)", - OfflineImapError.ERROR.REPO), - exc_info()[2]) + raise OfflineImapError("You can set at most one of the " + "following: maxage, startdate (for the local " + "folder), startdate (for the remote folder)", + OfflineImapError.ERROR.REPO, + exc_info()[2]) if (maxage is not None or localstart or remotestart) and quick: # IMAP quickchanged isn't compatible with options that # involve restricting the messagelist, since the "quick"