|
8 | 8 | import matplotlib.pyplot as plt |
9 | 9 | import numpy as np |
10 | 10 | from matplotlib.axes import Axes |
| 11 | +from matplotlib.backend_bases import NonGuiException |
11 | 12 | from matplotlib.figure import Figure |
12 | 13 | from matplotlib.widgets import CheckButtons, RadioButtons |
13 | 14 | from mpl_toolkits.mplot3d.axes3d import Axes3D |
@@ -79,12 +80,12 @@ def _reveal_auxiliary_figure(figure: Figure) -> None: |
79 | 80 | manager = getattr(figure.canvas, "manager", None) |
80 | 81 | manager_show = getattr(manager, "show", None) |
81 | 82 | if callable(manager_show): |
82 | | - with suppress(AttributeError, RuntimeError, TypeError, ValueError): |
| 83 | + with suppress(AttributeError, NonGuiException, RuntimeError, TypeError, ValueError): |
83 | 84 | manager_show() |
84 | 85 | else: |
85 | 86 | figure_show = getattr(figure, "show", None) |
86 | 87 | if callable(figure_show): |
87 | | - with suppress(AttributeError, RuntimeError, TypeError, ValueError): |
| 88 | + with suppress(AttributeError, NonGuiException, RuntimeError, TypeError, ValueError): |
88 | 89 | figure_show() |
89 | 90 | draw_idle = getattr(figure.canvas, "draw_idle", None) |
90 | 91 | if callable(draw_idle): |
|
0 commit comments