Mercurial > p > roundup > code
diff roundup/mailgw.py @ 5396:831787cf6694
Python 3 preparation: update next() usage for iterators.
Tool-assisted patch. Note that various classes in TAL code with
next() methods are not actually Python iterators and so are not
changed in this patch, but roundup/cgi/ZTUtils/Iterator.py includes
the IterIter class which converts between the two styles of iterator.
| author | Joseph Myers <jsm@polyomino.org.uk> |
|---|---|
| date | Tue, 24 Jul 2018 23:12:32 +0000 |
| parents | d26921b851c3 |
| children | 4cf48ff01e04 |
line wrap: on
line diff
--- a/roundup/mailgw.py Tue Jul 24 23:04:42 2018 +0000 +++ b/roundup/mailgw.py Tue Jul 24 23:12:32 2018 +0000 @@ -1351,11 +1351,11 @@ from mailbox import UnixMailbox mailbox = UnixMailbox(f, factory=Message) # grab one message - message = mailbox.next() + message = next(mailbox) while message: # handle this message self.handle_Message(message) - message = mailbox.next() + message = next(mailbox) # nuke the file contents os.ftruncate(f.fileno(), 0) except:
