From 5f41d9b3d5f3aa432a494bc8760f4e061e63ddd5 2013-03-04 23:03:36 From: MinRK Date: 2013-03-04 23:03:36 Subject: [PATCH] Backport PR #2668: pylab_not_importable: Catch all exceptions, not just RuntimeErrors. This catches situations when `pylab` isn't installed or fails for another reason like: ImportError: No module named backend_tkagg Closes gh-2646. --- diff --git a/IPython/lib/tests/test_irunner_pylab_magic.py b/IPython/lib/tests/test_irunner_pylab_magic.py index c7f405a..6536ba8 100644 --- a/IPython/lib/tests/test_irunner_pylab_magic.py +++ b/IPython/lib/tests/test_irunner_pylab_magic.py @@ -16,11 +16,11 @@ from IPython.lib import irunner from IPython.testing import decorators def pylab_not_importable(): - """Test if importing pylab fails with RuntimeError (true when having no display)""" + """Test if importing pylab fails. (For example, when having no display)""" try: import pylab return False - except RuntimeError: + except: return True # Testing code begins