From: W. Trevor King Date: Thu, 18 Oct 2012 18:09:53 +0000 (-0400) Subject: cmd.py: importing matplotlib without X can raise RuntimeErrors. X-Git-Tag: 0.6~12 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=d4be0cd34a3d6a0eb9452dd75f75ac325cb0cacb;p=pycomedi.git cmd.py: importing matplotlib without X can raise RuntimeErrors. For example, with the GTKAgg backend selected in ~/.matplotlib/matplotlibrc, running cmd.py without X raises: Traceback (most recent call last): File "./cmd.py", line 32, in from matplotlib import pyplot as _pyplot ... RuntimeError: could not create GdkCursor object --- diff --git a/doc/demo/cmd.py b/doc/demo/cmd.py index c21e0aa..cab117a 100755 --- a/doc/demo/cmd.py +++ b/doc/demo/cmd.py @@ -32,7 +32,7 @@ try: from matplotlib import pyplot as _pyplot from matplotlib.lines import Line2D as _Line2D #from matplotlib.animation import FuncAnimation as _FuncAnimation -except ImportError as e: +except (ImportError, RuntimeError) as e: _pyplot = None _matplotlib_import_error = e import numpy as _numpy