[py3k] import filter using six.moves
authorRémi Cardona <remi.cardona@logilab.fr>
Tue, 15 Sep 2015 14:59:06 +0200
changeset 10607 6519ae8cca0c
parent 10606 718e78ef6699
child 10608 7fc548d9dd8e
[py3k] import filter using six.moves
server/sqlutils.py
--- a/server/sqlutils.py	Tue Sep 15 14:58:52 2015 +0200
+++ b/server/sqlutils.py	Tue Sep 15 14:59:06 2015 +0200
@@ -25,9 +25,10 @@
 import re
 import subprocess
 from os.path import abspath
-from itertools import ifilter
 from logging import getLogger
 
+from six.moves import filter
+
 from logilab import database as db, common as lgc
 from logilab.common.shellutils import ProgressBar, DummyProgressBar
 from logilab.common.deprecation import deprecated
@@ -178,9 +179,9 @@
     # for mssql, we need to drop views before tables
     if hasattr(dbhelper, 'list_views'):
         cmds += ['DROP VIEW %s;' % name
-                 for name in ifilter(_SQL_DROP_ALL_USER_TABLES_FILTER_FUNCTION, dbhelper.list_views(sqlcursor))]
+                 for name in filter(_SQL_DROP_ALL_USER_TABLES_FILTER_FUNCTION, dbhelper.list_views(sqlcursor))]
     cmds += ['DROP TABLE %s;' % name
-             for name in ifilter(_SQL_DROP_ALL_USER_TABLES_FILTER_FUNCTION, dbhelper.list_tables(sqlcursor))]
+             for name in filter(_SQL_DROP_ALL_USER_TABLES_FILTER_FUNCTION, dbhelper.list_tables(sqlcursor))]
     return '\n'.join(cmds)