six: changed offlineimap/folder/Gmail.py

This patch removes the library six, compatible with python2.

I need change this re-raise call.

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:36:16 +02:00
parent 75c718c75b
commit bafcef77fd

View File

@ -19,8 +19,6 @@
import re import re
from sys import exc_info from sys import exc_info
import six
from offlineimap import imaputil, imaplibutil, OfflineImapError from offlineimap import imaputil, imaplibutil, OfflineImapError
import offlineimap.accounts import offlineimap.accounts
from .IMAP import IMAPFolder from .IMAP import IMAPFolder
@ -134,14 +132,13 @@ class GmailFolder(IMAPFolder):
res_type, response = imapobj.fetch("'%s'" % msgsToFetch, res_type, response = imapobj.fetch("'%s'" % msgsToFetch,
'(FLAGS X-GM-LABELS UID)') '(FLAGS X-GM-LABELS UID)')
if res_type != 'OK': if res_type != 'OK':
six.reraise(OfflineImapError, raise OfflineImapError(
OfflineImapError( "FETCHING UIDs in folder [%s]%s failed. " %
"FETCHING UIDs in folder [%s]%s failed. " % (self.getrepository(), self) +
(self.getrepository(), self) + "Server responded '[%s] %s'" %
"Server responded '[%s] %s'" % (res_type, response),
(res_type, response), OfflineImapError.ERROR.FOLDER,
OfflineImapError.ERROR.FOLDER), exc_info()[2])
exc_info()[2])
finally: finally:
self.imapserver.releaseconnection(imapobj) self.imapserver.releaseconnection(imapobj)