From d4be0cd34a3d6a0eb9452dd75f75ac325cb0cacb Mon Sep 17 00:00:00 2001 From: "W. Trevor King" Date: Thu, 18 Oct 2012 14:09:53 -0400 Subject: [PATCH] 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 --- doc/demo/cmd.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 -- 2.26.2