[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

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



commit 4cacc2c3a31530d67c7609f8f33e0c8f57ef4bf9
Author: David Fifield <david@xxxxxxxxxxxxxxx>
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

_______________________________________________
tor-commits mailing list
tor-commits@xxxxxxxxxxxxxxxxxxxx
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits