Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def next(self):
self.curnum += 1
try:
typ, data = self.imap.uid('fetch',self.numbers[self.curnum],'(RFC822)')
if data == None:
return StopIteration
except IndexError:
raise StopIteration
return IMAPMail(self.conn,self.mailbox,self.seen,self.numbers[self.curnum],data[0][1])