failure to obtain uid indicated by savemessage_searchforheader return value <= 0, not ValueError

This commit is contained in:
Adam Spiers 2006-05-16 04:30:48 +01:00
parent 720511f3f1
commit 2e52bcdafe

View File

@ -231,11 +231,10 @@ class IMAPFolder(BaseFolder):
assert(imapobj.check()[0] == 'OK') assert(imapobj.check()[0] == 'OK')
# Keep trying until we get the UID. # Keep trying until we get the UID.
try: ui.debug('imap', 'savemessage: first attempt to get new UID')
ui.debug('imap', 'savemessage: first attempt to get new UID') uid = self.savemessage_searchforheader(imapobj, headername,
uid = self.savemessage_searchforheader(imapobj, headername, headervalue)
headervalue) if uid <= 0:
except ValueError:
ui.debug('imap', 'savemessage: first attempt to get new UID failed. Going to run a NOOP and try again.') ui.debug('imap', 'savemessage: first attempt to get new UID failed. Going to run a NOOP and try again.')
assert(imapobj.noop()[0] == 'OK') assert(imapobj.noop()[0] == 'OK')
uid = self.savemessage_searchforheader(imapobj, headername, uid = self.savemessage_searchforheader(imapobj, headername,