Revision: 6687 Author: russblau Date: 2009-04-23 20:52:55 +0000 (Thu, 23 Apr 2009)
Log Message: ----------- Can't use .iterkeys() when you are changing the dictionary's keys within the loop
Modified Paths: -------------- branches/rewrite/scripts/category_redirect.py
Modified: branches/rewrite/scripts/category_redirect.py =================================================================== --- branches/rewrite/scripts/category_redirect.py 2009-04-23 20:25:23 UTC (rev 6686) +++ branches/rewrite/scripts/category_redirect.py 2009-04-23 20:52:55 UTC (rev 6687) @@ -489,7 +489,7 @@ ## % cat.title(asLink=True, textlink=True))
# delete record entries for non-existent categories - for cat_name in record.iterkeys(): + for cat_name in record.keys(): if pywikibot.Category( pywikibot.Link(self.catprefix+cat_name, self.site) ) not in catmap: @@ -497,7 +497,7 @@
pywikibot.output(u"") pywikibot.output(u"Checking %s destination categories" % len(destmap)) - for dest in pagegenerators.PreloadingGenerator(destmap.iterkeys()): + for dest in pagegenerators.PreloadingGenerator(destmap): if not dest.exists(): for d in destmap[dest]: problems.append("# %s redirects to %s"