Rigth comparison with err EEXIST
This is the right code. The OSError doesn't have the EEXIST variable.
This commit is contained in:
parent
3d5f926552
commit
62df6e70c3
@ -15,6 +15,7 @@
|
|||||||
# along with this program; if not, write to the Free Software
|
# along with this program; if not, write to the Free Software
|
||||||
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||||
|
|
||||||
|
import errno
|
||||||
import socket
|
import socket
|
||||||
import time
|
import time
|
||||||
import re
|
import re
|
||||||
@ -311,7 +312,7 @@ class MaildirFolder(BaseFolder):
|
|||||||
except OSError as e:
|
except OSError as e:
|
||||||
if not hasattr(e, 'EEXIST'):
|
if not hasattr(e, 'EEXIST'):
|
||||||
raise
|
raise
|
||||||
if e.errno == e.EEXIST:
|
if e.errno == errno.EEXIST:
|
||||||
if tries:
|
if tries:
|
||||||
time.sleep(0.23)
|
time.sleep(0.23)
|
||||||
continue
|
continue
|
||||||
|
Loading…
Reference in New Issue
Block a user