[rql rewriter] don't add unnecessary (potentially buggy) exists stable
authorSylvain Thénault <sylvain.thenault@logilab.fr>
Wed, 30 Mar 2011 11:07:07 +0200
branchstable
changeset 7137 01b23ec9c066
parent 7136 5406c963ee81
child 7138 9aba650eea6b
[rql rewriter] don't add unnecessary (potentially buggy) exists
rqlrewrite.py
--- a/rqlrewrite.py	Tue Mar 29 10:25:10 2011 +0200
+++ b/rqlrewrite.py	Wed Mar 30 11:07:07 2011 +0200
@@ -252,7 +252,8 @@
                 self.insert_pending()
                 self._insert_scope = None
                 return
-            new = n.Exists(new)
+            if not isinstance(new, (n.Exists, n.Not)):
+                new = n.Exists(new)
             if parent is None:
                 insert_scope.add_restriction(new)
             else: