py3: raise exceptions using six module
There is no other way to make Python2 and Python3 happy, because syntax raise E, V, T is incompatible with the latter. Signed-off-by: Łukasz Żarnowiecki <dolohow@outlook.com> Signed-off-by: Nicolas Sebrecht <nicolas.s-dev@laposte.net>
This commit is contained in:

committed by
Nicolas Sebrecht

parent
83539f8601
commit
0addcbabf0
@ -27,6 +27,8 @@ from offlineimap.folder.UIDMaps import MappedIMAPFolder
|
||||
from offlineimap.threadutil import ExitNotifyThread
|
||||
from offlineimap.utils.distro import get_os_sslcertfile, get_os_sslcertfile_searchpath
|
||||
|
||||
import six
|
||||
|
||||
|
||||
class IMAPRepository(BaseRepository):
|
||||
def __init__(self, reposname, account):
|
||||
@ -107,9 +109,8 @@ class IMAPRepository(BaseRepository):
|
||||
try:
|
||||
host = self.localeval.eval(host)
|
||||
except Exception as e:
|
||||
raise OfflineImapError("remotehosteval option for repository "
|
||||
"'%s' failed:\n%s"% (self, e), OfflineImapError.ERROR.REPO), \
|
||||
None, exc_info()[2]
|
||||
six.reraise(OfflineImapError("remotehosteval option for repository "
|
||||
"'%s' failed:\n%s"% (self, e), OfflineImapError.ERROR.REPO), None, exc_info()[2])
|
||||
if host:
|
||||
self._host = host
|
||||
return self._host
|
||||
|
Reference in New Issue
Block a user