10000 Backport PR #15206: FIX: be more forgiving about expecting internal s… · matplotlib/matplotlib@04a2d11 · GitHub
[go: up one dir, main page]

Skip to content

Commit 04a2d11

Browse files
dstansbytacaswell
authored andcommitted
Backport PR #15206: FIX: be more forgiving about expecting internal state in draw_idle
Merge pull request #15206 from tacaswell/fix_python_ion_second_qtcanvas_init FIX: be more forgiving about expecting internal state in draw_idle Conflicts: lib/matplotlib/tests/test_backend_qt.py - no tests on this branch, did not backport test
1 parent 053eea9 commit 04a2d11

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

lib/matplotlib/backends/backend_qt5.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -506,7 +506,8 @@ def draw_idle(self):
506506
# current event loop in order to ensure thread affinity and to
507507
# accumulate multiple draw requests from event handling.
508508
# TODO: queued signal connection might be safer than singleShot
509-
if not (self._draw_pending or self._is_drawing):
509+
if not (getattr(self, '_draw_pending', False) or
510+
getattr(self, '._is_drawing', False)):
510511
self._draw_pending = True
511512
QtCore.QTimer.singleShot(0, self._draw_idle)
512513

0 commit comments

Comments
 (0)
0