[pypy-svn] r15786 - pypy/dist/pypy/objspace/std

ale at codespeak.net ale at codespeak.net
Mon Aug 8 20:13:50 CEST 2005


Author: ale
Date: Mon Aug  8 20:13:49 2005
New Revision: 15786

Modified:
   pypy/dist/pypy/objspace/std/dictobject.py
Log:
added a check for w_dict.len == -1 signaling an invalid iterator

Modified: pypy/dist/pypy/objspace/std/dictobject.py
==============================================================================
--- pypy/dist/pypy/objspace/std/dictobject.py	(original)
+++ pypy/dist/pypy/objspace/std/dictobject.py	Mon Aug  8 20:13:49 2005
@@ -362,7 +362,7 @@
 
 def len__DictIterObject(space, w_dictiter):
     w_dict = w_dictiter.w_dictobject
-    if w_dict is None:
+    if w_dict is None or w_dictiter.len == -1 :
         return space.wrap(0)
     return space.wrap(w_dictiter.len - w_dictiter.pos)
 # ____________________________________________________________



More information about the Pypy-commit mailing list