server/msplanner.py
changeset 8696 0bb18407c053
parent 7886 b1c913a6d9f0
child 9167 c05652b108ce
--- a/server/msplanner.py	Thu Feb 14 15:38:25 2013 +0100
+++ b/server/msplanner.py	Thu Feb 14 16:01:24 2013 +0100
@@ -1075,7 +1075,7 @@
         """return all sources supporting given term / solindices"""
         sources = [selected_source]
         sourcesterms = self._sourcesterms
-        for source in sourcesterms.keys():
+        for source in list(sourcesterms):
             if source is selected_source:
                 continue
             if not (term in sourcesterms[source] and
@@ -1099,9 +1099,9 @@
         # term has to belong to the same scope if there is more
         # than the system source remaining
         if len(sourcesterms) > 1 and not scope is self.rqlst:
-            candidates = (t for t in sourceterms.keys() if scope is ms_scope(t))
+            candidates = (t for t in sourceterms if scope is ms_scope(t))
         else:
-            candidates = sourceterms #.iterkeys()
+            candidates = sourceterms
         # we only want one unlinked term in each generated query
         candidates = [t for t in candidates
                       if isinstance(t, (Constant, Relation)) or