From: W. Trevor King Date: Tue, 15 Jan 2013 16:08:56 +0000 (-0500) Subject: FFT_tools: Catch RuntimeErrors when importing matplotlib X-Git-Url: http://git.tremily.us/?p=FFT-tools.git;a=commitdiff_plain;h=HEAD;hp=27f87d1cb575d7378c946c935efb483dc2f286da 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 --- 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