Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 188d7a1

Browse files
committed
DOC: protect against non-gui backends in demo
1 parent 8f2b84c commit 188d7a1

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

examples/pylab_examples/system_monitor.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,8 +47,10 @@ def get_stats():
4747
pm.set_height(m)
4848
pc.set_height(c)
4949
pn.set_height(n)
50-
51-
fig.canvas.flush_events()
50+
try:
51+
fig.canvas.flush_events()
52+
except NotImplementedError:
53+
pass
5254

5355
stop = time.time()
5456
print("{fps:.1f} frames per second".format(fps=200 / (stop - start)))

0 commit comments

Comments
 (0)