six: changed offlineimap/repository/__init__.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 21:06:06 +02:00
parent 6321a66287
commit 35b588f57e

View File

@ -15,7 +15,6 @@
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
from sys import exc_info
import six
try:
from configparser import NoSectionError
@ -68,18 +67,16 @@ class Repository:
except NoSectionError:
errstr = ("Could not find section '%s' in configuration. Required "
"for account '%s'." % ('Repository %s' % name, account))
six.reraise(OfflineImapError,
OfflineImapError(errstr, OfflineImapError.ERROR.REPO),
exc_info()[2])
raise OfflineImapError(errstr, OfflineImapError.ERROR.REPO,
exc_info()[2])
try:
repo = typemap[repostype]
except KeyError:
errstr = "'%s' repository not supported for '%s' repositories." % \
(repostype, reqtype)
six.reraise(OfflineImapError,
OfflineImapError(errstr, OfflineImapError.ERROR.REPO),
exc_info()[2])
raise OfflineImapError(errstr, OfflineImapError.ERROR.REPO,
exc_info()[2])
return repo(name, account)