Skip to content
Snippets Groups Projects
Commit 3404000f authored by Jameson Rollins's avatar Jameson Rollins
Browse files

cli: better error handling for matplotlib import errors

actually fail if plots are requested but can't be generated.
parent 738a8ba8
No related branches found
No related tags found
No related merge requests found
......@@ -202,9 +202,10 @@ def main():
matplotlib.use('AGG')
try:
from matplotlib import pyplot as plt
except ImportError as e:
parser.exit(5, f"ImportError: {e}\n")
except RuntimeError:
logger.warning("no display, plotting disabled.")
args.plot = False
parser.exit(10, "Could not open display for plotting.\n")
if args.range:
try:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment