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 8c16c61

Browse filesBrowse files
committed
Merge pull request #2677 from tacaswell/fix_2583
Make sure self._idle is set to `True` in all cases
2 parents 1a9fa9e + a6fbc7f commit 8c16c61
Copy full SHA for 8c16c61

File tree

Expand file treeCollapse file tree

4 files changed

+16
-8
lines changed
Filter options
Expand file treeCollapse file tree

4 files changed

+16
-8
lines changed

‎lib/matplotlib/backends/backend_gtk.py

Copy file name to clipboardExpand all lines: lib/matplotlib/backends/backend_gtk.py
+4-2Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -376,8 +376,10 @@ def draw(self):
376376

377377
def draw_idle(self):
378378
def idle_draw(*args):
379-
self.draw()
380-
self._idle_draw_id = 0
379+
try:
380+
self.draw()
381+
finally:
382+
self._idle_draw_id = 0
381383
return False
382384
if self._idle_draw_id == 0:
383385
self._idle_draw_id = gobject.idle_add(idle_draw)

‎lib/matplotlib/backends/backend_gtk3.py

Copy file name to clipboardExpand all lines: lib/matplotlib/backends/backend_gtk3.py
+4-2Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -322,8 +322,10 @@ def draw(self):
322322

323323
def draw_idle(self):
324324
def idle_draw(*args):
325-
self.draw()
326-
self._idle_draw_id = 0
325+
try:
326+
self.draw()
327+
finally:
328+
self._idle_draw_id = 0
327329
return False
328330
if self._idle_draw_id == 0:
329331
self._idle_draw_id = GObject.idle_add(idle_draw)

‎lib/matplotlib/backends/backend_qt4.py

Copy file name to clipboardExpand all lines: lib/matplotlib/backends/backend_qt4.py
+4-2Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -415,8 +415,10 @@ def draw_idle(self):
415415
self._idle = False
416416

417417
def idle_draw(*args):
418-
self.draw()
419-
self._idle = True
418+
try:
419+
self.draw()
420+
finally:
421+
self._idle = True
420422
if d:
421423
QtCore.QTimer.singleShot(0, idle_draw)
422424

‎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.