Skip to content
Snippets Groups Projects
Commit bc0195ba authored by Gabriel Ganne's avatar Gabriel Ganne
Browse files

Fix scapy init without gtk

matplotlib.pyplot inits gtk, which may not be available.
If so, handles this as if the import failed.
parent b859999d
No related branches found
No related tags found
No related merge requests found
......@@ -21,7 +21,8 @@ try:
else:
MATPLOTLIB_INLINED = 0
MATPLOTLIB_DEFAULT_PLOT_KARGS = {"marker": "+"}
except ImportError:
# RuntimeError to catch gtk "Cannot open display" error
except (ImportError, RuntimeError) as e:
plt = None
MATPLOTLIB = 0
MATPLOTLIB_INLINED = 0
......
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