From 62df6e70c36c2d65123e7208e9ce9c2abbf19649 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rodolfo=20Garc=C3=ADa=20Pe=C3=B1as=20=28kix=29?= Date: Mon, 12 Oct 2020 01:35:20 +0200 Subject: [PATCH] Rigth comparison with err EEXIST This is the right code. The OSError doesn't have the EEXIST variable. --- offlineimap/folder/Maildir.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/offlineimap/folder/Maildir.py b/offlineimap/folder/Maildir.py index f06217b..ca42e13 100644 --- a/offlineimap/folder/Maildir.py +++ b/offlineimap/folder/Maildir.py @@ -15,6 +15,7 @@ # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA +import errno import socket import time import re @@ -311,7 +312,7 @@ class MaildirFolder(BaseFolder): except OSError as e: if not hasattr(e, 'EEXIST'): raise - if e.errno == e.EEXIST: + if e.errno == errno.EEXIST: if tries: time.sleep(0.23) continue