From 184f9fe2f74999efe33894db337ef025970ec1ff Mon Sep 17 00:00:00 2001 From: "W. Trevor King" Date: Tue, 15 Jan 2013 11:08:56 -0500 Subject: [PATCH] FFT_tools: Catch RuntimeErrors when importing matplotlib For example, if your default backend is GTKAgg, but you don't have $DISPLAY set, you can get: RuntimeError: could not create GdkCursor object --- FFT_tools.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/FFT_tools.py b/FFT_tools.py index e85e430..e6d058c 100644 --- a/FFT_tools.py +++ b/FFT_tools.py @@ -32,7 +32,7 @@ import unittest as _unittest import numpy as _numpy try: import matplotlib.pyplot as _pyplot -except ImportError as e: +except (ImportError, RuntimeError) as e: _pyplot = None _pyplot_import_error = e -- 2.26.2