OSError does not include __getitem__

This patch removes the issue about using [] with
OSError instances. This es an old method from Python2.

This patch is related to issue #37, issue 4.
This commit is contained in:
Rodolfo García Peñas (kix) 2021-07-25 13:25:04 +02:00
parent 33f3b4b1aa
commit c305f47e84
2 changed files with 3 additions and 3 deletions

View File

@ -183,7 +183,7 @@ class GmailMaildirFolder(MaildirFolder):
os.rename(tmppath, filepath)
except OSError as e:
raise OfflineImapError("Can't rename file '%s' to '%s': %s" %
(tmppath, filepath, e[1]),
(tmppath, filepath, e.errno),
OfflineImapError.ERROR.FOLDER,
exc_info()[2])

View File

@ -470,7 +470,7 @@ class MaildirFolder(BaseFolder):
except OSError as e:
raise OfflineImapError(
"Can't rename file '%s' to '%s': %s" %
(oldfilename, newfilename, e[1]),
(oldfilename, newfilename, e.errno),
OfflineImapError.ERROR.FOLDER,
exc_info()[2])
@ -556,7 +556,7 @@ class MaildirFolder(BaseFolder):
except OSError as e:
raise OfflineImapError(
"Can't rename file '%s' to '%s': %s" %
(filename, newfilename, e[1]),
(filename, newfilename, e.errno),
OfflineImapError.ERROR.FOLDER,
exc_info()[2])