Make the test suite runnable without X11 connections.

This fix makes the test suite work in settings like a screen session that
can import but not initialize GTK.
This commit is contained in:
Fernando Perez 2010-01-16 14:50:08 -08:00
parent 5740081c62
commit ecff1e9e39

View File

@ -81,7 +81,9 @@ def test_for(mod):
"""Test to see if mod is importable."""
try:
__import__(mod)
except ImportError:
except (ImportError, RuntimeError):
# GTK reports Runtime error if it can't be initialized even if it's
# importable.
return False
else:
return True