filterwarnings only when necessary
authorSylvain Thénault <sylvain.thenault@logilab.fr>
Tue, 09 Mar 2010 10:46:15 +0100
changeset 503 7abe7da80684
parent 502 f35e05bc3df6
child 504 7d4313c2f12d
filterwarnings only when necessary
analyze.py
--- a/analyze.py	Mon Mar 08 18:07:20 2010 +0100
+++ b/analyze.py	Tue Mar 09 10:46:15 2010 +0100
@@ -7,8 +7,6 @@
 __docformat__ = "restructuredtext en"
 
 from cStringIO import StringIO
-import warnings
-warnings.filterwarnings(action='ignore', module='logilab.constraint.propagation')
 
 from rql import TypeResolverException, nodes
 from pprint import pprint
@@ -20,6 +18,8 @@
     import rql_solve
 except ImportError:
     rql_solve = None
+    import warnings
+    warnings.filterwarnings(action='ignore', module='logilab.constraint.propagation')
     from logilab.constraint import Repository, Solver, fd
 
     # Gecode solver not available