[shell] rql() should use unsafe_execute when possible stable
authorSylvain Thénault <sylvain.thenault@logilab.fr>
Mon, 15 Feb 2010 15:17:24 +0100
branchstable
changeset 4580 9fce32b5d219
parent 4579 19d73051eb57
child 4581 c92ded4dee20
[shell] rql() should use unsafe_execute when possible
server/migractions.py
--- a/server/migractions.py	Mon Feb 15 15:16:08 2010 +0100
+++ b/server/migractions.py	Mon Feb 15 15:17:24 2010 +0100
@@ -1166,6 +1166,10 @@
         if not isinstance(rql, (tuple, list)):
             rql = ( (rql, kwargs), )
         res = None
+        try:
+            execute = self._cw.unsafe_execute
+        except AttributeError:
+            execute = self._cw.execute
         for rql, kwargs in rql:
             if kwargs:
                 msg = '%s (%s)' % (rql, kwargs)
@@ -1173,7 +1177,7 @@
                 msg = rql
             if not ask_confirm or self.confirm('execute rql: %s ?' % msg):
                 try:
-                    res = self._cw.execute(rql, kwargs, cachekey)
+                    res = execute(rql, kwargs, cachekey)
                 except Exception, ex:
                     if self.confirm('error: %s\nabort?' % ex):
                         raise