Skip to content

Commit

Permalink
Catch Exception if matplotlib can not be imported in __init__.py
Browse files Browse the repository at this point in the history
  • Loading branch information
dzimmerer committed Sep 28, 2020
1 parent 33826ad commit dc203d7
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions trixi/__init__.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
use_agg = False
import matplotlib
if use_agg: matplotlib.use("Agg", warn=False)
try:
use_agg = False
import matplotlib

if use_agg:
matplotlib.use("Agg", warn=False)
except Exception:
print("Failed to import matplotlib")
__version__ = "0.1.2.2"

0 comments on commit dc203d7

Please sign in to comment.