Disable sqlalchemy warnings if applicable

This commit is contained in:
stamparm 2013-04-15 16:29:08 +02:00
parent 1c2197e8de
commit de99717b00

View File

@ -8,11 +8,13 @@ See the file 'doc/COPYING' for copying permission
import imp import imp
import os import os
import sys import sys
import warnings
_sqlalchemy = None _sqlalchemy = None
try: try:
f, pathname, desc = imp.find_module("sqlalchemy", sys.path[1:]) f, pathname, desc = imp.find_module("sqlalchemy", sys.path[1:])
_sqlalchemy = imp.load_module("sqlalchemy", f, pathname, desc) _sqlalchemy = imp.load_module("sqlalchemy", f, pathname, desc)
warnings.simplefilter(action="ignore", category=_sqlalchemy.exc.SAWarning)
except ImportError: except ImportError:
pass pass