[Python-checkins] CVS: python/dist/src/Lib mailbox.py,1.32,1.33

Guido van Rossum gvanrossum@users.sourceforge.net
Wed, 12 Sep 2001 18:29:15 -0700


Update of /cvsroot/python/python/dist/src/Lib
In directory usw-pr-cvs1:/tmp/cvs-serv25131

Modified Files:
	mailbox.py 
Log Message:
SF bug #461073: mailbox __iter__ bug, by Andrew Dalke.

Andrew quite correctly notices that the next() method isn't quite what
we need, since it returns None upon end instead of raising
StopIteration.  His fix is easy enough, using iter(self.next, None)
instead.


Index: mailbox.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Lib/mailbox.py,v
retrieving revision 1.32
retrieving revision 1.33
diff -C2 -d -r1.32 -r1.33
*** mailbox.py	2001/08/13 15:37:02	1.32
--- mailbox.py	2001/09/13 01:29:13	1.33
***************
*** 16,20 ****
  
      def __iter__(self):
!         return self
  
      def next(self):
--- 16,20 ----
  
      def __iter__(self):
!         return iter(self.next, None)
  
      def next(self):
***************
*** 196,200 ****
  
      def __iter__(self):
!         return self
  
      def next(self):
--- 196,200 ----
  
      def __iter__(self):
!         return iter(self.next, None)
  
      def next(self):
***************
*** 227,231 ****
  
      def __iter__(self):
!         return self
  
      def next(self):
--- 227,231 ----
  
      def __iter__(self):
!         return iter(self.next, None)
  
      def next(self):