We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent eab4a89 commit 2396e90Copy full SHA for 2396e90
lib/matplotlib/tests/test_backends_interactive.py
@@ -288,10 +288,13 @@ def _test_thread_impl():
288
future = ThreadPoolExecutor().submit(fig.canvas.draw)
289
plt.pause(0.5) # flush_events fails here on at least Tkagg (bpo-41176)
290
future.result() # Joins the thread; rethrows any exception.
291
+ # stash the current canvas as closing the figure will reset the canvas on
292
+ # the figure
293
+ canvas = fig.canvas
294
plt.close() # backend is responsible for flushing any events here
295
if plt.rcParams["backend"].lower().startswith("wx"):
296
# TODO: debug why WX needs this only on py >= 3.8
- fig.canvas.flush_events()
297
+ canvas.flush_events()
298
299
300
_thread_safe_backends = _get_testable_interactive_backends()
0 commit comments