From 8010c347226bcbb22123a89c4ac2d8676612cd19 Mon Sep 17 00:00:00 2001 From: "W. Trevor King" Date: Wed, 27 Jul 2011 12:08:43 -0400 Subject: [PATCH] Also catch RuntimeError when importing pyplot in pid_response.py. In case matplotlib is installed, but poorly configured for your current situation. For example, if you've SSHed into a host without tunneling X, you can see: $ python -c 'import matplotlib.pyplot' /usr/lib/python2.7/site-packages/gtk-2.0/gtk/__init__.py:57: GtkWarning: could not open display ... RuntimeError: could not create GdkCursor object --- examples/pid_repsonse.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/pid_repsonse.py b/examples/pid_repsonse.py index 33311cb..f2216b6 100755 --- a/examples/pid_repsonse.py +++ b/examples/pid_repsonse.py @@ -25,7 +25,7 @@ from time import sleep try: from matplotlib import pyplot from numpy import loadtxt -except ImportError, e: +except (ImportError,RuntimeError), e: pyplot = None loadtxt = None plot_import_error = e -- 2.26.2