cross relations handling fix 3.0
authorsylvain.thenault@logilab.fr
Thu, 15 Jan 2009 15:59:08 +0100
branch3.0
changeset 433 95cb5b6e15c6
parent 432 8a7f619fce96
child 435 7c19ba5bfbbb
cross relations handling fix
server/msplanner.py
--- a/server/msplanner.py	Thu Jan 15 14:39:19 2009 +0100
+++ b/server/msplanner.py	Thu Jan 15 15:59:08 2009 +0100
@@ -288,17 +288,21 @@
                 flag = 0
                 for v in crossvars:
                     if isinstance(v, Constant):
-                        self._sourcesvars[ssource][v] = set(self._solindices)
+                        allsols = set(self._solindices)
+                        try:
+                            self._sourcesvars[ssource][v] = allsols
+                        except KeyError:
+                            self._sourcesvars[ssource] = {v: allsols}
                     if len(vsources[v]) == 1:
                         if iter(vsources[v]).next()[0].uri == 'system':
                             flag = 1
                             for ov in crossvars:
-                                if ov is not v and ov._q_invariant:
+                                if ov is not v and (isinstance(ov, Constant) or ov._q_invariant):
                                     ssset = frozenset((ssource,))
                                     self._remove_sources(ov, vsources[ov] - ssset)
                         else:
                             for ov in crossvars:
-                                if ov is not v and ov._q_invariant:
+                                if ov is not v and (isinstance(ov, Constant) or ov._q_invariant):
                                     needsplit = False
                                     break
                             else: