changeset 1871:89a95d272881

re-add some .keys() calls when we modify the dict in the loop
author Thomas Waldmann <tw AT waldmann-edv DOT de>
date Sat, 10 Mar 2007 23:50:54 +0100
parents 9406e02388cf
children a58046e1490d
files MoinMoin/action/LikePages.py MoinMoin/macro/PageHits.py MoinMoin/parser/text_rst.py MoinMoin/script/maint/mkpagepacks.py
diffstat 4 files changed, 4 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/MoinMoin/action/LikePages.py	Sat Mar 10 23:16:23 2007 +0100
+++ b/MoinMoin/action/LikePages.py	Sat Mar 10 23:50:54 2007 +0100
@@ -102,7 +102,7 @@
 
     # Filter deleted pages or pages the user can't read from
     # matches. Order is important!
-    for name in matches:
+    for name in matches.keys(): # we need .keys() because we modify the dict
         page = Page(request, name)
         if not (page.exists() and request.user.may.read(name)):
             del matches[name]
--- a/MoinMoin/macro/PageHits.py	Sat Mar 10 23:16:23 2007 +0100
+++ b/MoinMoin/macro/PageHits.py	Sat Mar 10 23:50:54 2007 +0100
@@ -69,7 +69,7 @@
     def filterReadableHits(self, hits):
         """ Filter out hits the user many not see """
         userMayRead = self.request.user.may.read
-        for pagename in hits:
+        for pagename in hits.keys(): # we need .keys() because we modify the dict
             page = Page(self.request, pagename)
             if page.exists() and userMayRead(pagename):
                 continue
--- a/MoinMoin/parser/text_rst.py	Sat Mar 10 23:16:23 2007 +0100
+++ b/MoinMoin/parser/text_rst.py	Sat Mar 10 23:50:54 2007 +0100
@@ -87,7 +87,7 @@
 # Go through and change all docutils modules to use a dummyOpen and dummyUrllib2
 # module. Also make sure that any docutils imported modules also get the dummy
 # implementations.
-for i in sys.modules:
+for i in sys.modules.keys():
     if i.startswith('docutils') and sys.modules[i]:
         sys.modules[i].open = dummyOpen
         sys.modules[i].urllib2 = dummyUrllib2
--- a/MoinMoin/script/maint/mkpagepacks.py	Sat Mar 10 23:16:23 2007 +0100
+++ b/MoinMoin/script/maint/mkpagepacks.py	Sat Mar 10 23:50:54 2007 +0100
@@ -60,7 +60,7 @@
 
         pageSets[ALL] = langPages
 
-        for name in pageSets:
+        for name in pageSets.keys():
             if name not in (u"English"):
                 pageSets[name] -= pageSets[u"English"]
                 pageSets[name] -= nodistPages