six: changed offlineimap/accounts.py

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) <kix@kix.es>
This commit is contained in:
Rodolfo García Peñas (kix) 2020-09-03 20:06:15 +02:00
parent df4b9174d7
commit b8137a8028

View File

@ -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"