six: changed offlineimap/folder/UIDMaps.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:33:30 +02:00
parent dd3e7616cf
commit 75c718c75b

View File

@ -20,7 +20,6 @@ import shutil
from os import fsync, unlink
from sys import exc_info
from threading import Lock
import six
try:
import portalocker
@ -89,11 +88,11 @@ class MappedIMAPFolder(IMAPFolder):
try:
line = line.strip()
except ValueError:
six.reraise(Exception,
Exception(
raise Exception(
"Corrupt line '%s' in UID mapping file '%s'" %
(line, mapfilename)),
(line, mapfilename),
exc_info()[2])
(str1, str2) = line.split(':')
loc = int(str1)
rem = int(str2)
@ -129,13 +128,12 @@ class MappedIMAPFolder(IMAPFolder):
try:
return [mapping[x] for x in items]
except KeyError as e:
six.reraise(OfflineImapError,
OfflineImapError(
raise OfflineImapError(
"Could not find UID for msg '{0}' (f:'{1}'."
" This is usually a bad thing and should be "
"reported on the mailing list.".format(
e.args[0], self),
OfflineImapError.ERROR.MESSAGE),
OfflineImapError.ERROR.MESSAGE,
exc_info()[2])
# Interface from BaseFolder