Skip to content

Commit a6fbc7f

Browse files
committed
added try block in backend_tkagg.py
Added try block around `draw` in `idle_draw`. If `draw` raises an exception the figure is never marked idle again and pyplot functions will not work as expect.
1 parent ed8e357 commit a6fbc7f

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

lib/matplotlib/backends/backend_tkagg.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -362,8 +362,10 @@ def draw_idle(self):
362362
d = self._idle
363363
self._idle = False
364364
def idle_draw(*args):
365-
self.draw()
366-
self._idle = True
365+
try:
366+
self.draw()
367+
finally:
368+
self._idle = True
367369

368370
if d:
369371
self._idle_callback = self._tkcanvas.after_idle(idle_draw)

0 commit comments

Comments
 (0)