Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit a6fbc7f

Browse filesBrowse 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
Copy full SHA for a6fbc7f

File tree

Expand file treeCollapse file tree

1 file changed

+4
-2
lines changed
Filter options
Expand file treeCollapse file tree

1 file changed

+4
-2
lines changed

‎lib/matplotlib/backends/backend_tkagg.py

Copy file name to clipboardExpand all lines: lib/matplotlib/backends/backend_tkagg.py
+4-2Lines 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 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.