six: changed offlineimap/folder/GmailMaildir.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:38:05 +02:00
parent bafcef77fd
commit 4b32d62fe9

View File

@ -18,8 +18,6 @@
import os import os
from sys import exc_info from sys import exc_info
import six
import offlineimap.accounts import offlineimap.accounts
from offlineimap import OfflineImapError from offlineimap import OfflineImapError
from offlineimap import imaputil from offlineimap import imaputil
@ -181,11 +179,10 @@ class GmailMaildirFolder(MaildirFolder):
try: try:
os.rename(tmppath, filepath) os.rename(tmppath, filepath)
except OSError as e: except OSError as e:
six.reraise(OfflineImapError, raise OfflineImapError("Can't rename file '%s' to '%s': %s" %
OfflineImapError("Can't rename file '%s' to '%s': %s" % (tmppath, filepath, e[1]),
(tmppath, filepath, e[1]), OfflineImapError.ERROR.FOLDER,
OfflineImapError.ERROR.FOLDER), exc_info()[2])
exc_info()[2])
# If utime_from_header=true, we don't want to change the mtime. # If utime_from_header=true, we don't want to change the mtime.
if self._utime_from_header and mtime: if self._utime_from_header and mtime: