[tor-commits] [flashproxy/master] Raise an exception on UID parsing failure.

dcf at torproject.org dcf at torproject.org
Fri Oct 12 11:42:10 UTC 2012


commit 4cacc2c3a31530d67c7609f8f33e0c8f57ef4bf9
Author: David Fifield <david at bamsoftware.com>
Date:   Fri Oct 12 04:32:55 2012 -0700

    Raise an exception on UID parsing failure.
---
 facilitator/facilitator-email-poller |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/facilitator/facilitator-email-poller b/facilitator/facilitator-email-poller
index 5f26edd..8bb90ca 100755
--- a/facilitator/facilitator-email-poller
+++ b/facilitator/facilitator-email-poller
@@ -259,7 +259,8 @@ def imap_get_uid(imap, index):
     # This grepping for the UID is bogus, but imaplib doesn't properly break up
     # the list of name-value pairs for us.
     m = re.match(r'^\d+\s+\(.*\bUID\s+(\d+)\b.*\)\s*$', data[0])
-    assert m is not None
+    if m is None:
+        raise imaplib.IMAP4.abort("Can't find UID in %s" % repr(data[0]))
     return m.group(1)
 
 # Gmail's IMAP folders are funny: they are not real folders, but actually views



More information about the tor-commits mailing list