1
0
Fork 0

Add handling for situations in which the message was deleted in another thread before processing.

This commit is contained in:
Adam Coddington 2015-07-07 23:05:15 -07:00
parent 6183f68b39
commit 5bcbac33d6

View file

@ -103,7 +103,13 @@ class ImapTransport(EmailTransport):
typ, msg_contents = self.server.uid('fetch', uid, '(RFC822)')
if not msg_contents:
continue
message = self.get_email_from_bytes(msg_contents[0][1])
try:
message = self.get_email_from_bytes(msg_contents[0][1])
except TypeError:
# This happens if another thread/process deletes the
# message between our generating the ID list and our
# processing it here.
continue
if condition and not condition(message):
continue