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 8866eff

Browse filesBrowse files
committed
MNT: Ensure positive interval for timers
Some backends don't handle 0 interval timers, so we can just set a minimum of 1 millisecond for the resolution of the timer to ensure a positive interval passed to all backend timers.
1 parent 83cd2cd commit 8866eff
Copy full SHA for 8866eff

File tree

Expand file treeCollapse file tree

1 file changed

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

1 file changed

+2
-1
lines changed

‎lib/matplotlib/backend_bases.py

Copy file name to clipboardExpand all lines: lib/matplotlib/backend_bases.py
+2-1Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1164,7 +1164,8 @@ def interval(self):
11641164
def interval(self, interval):
11651165
# Force to int since none of the backends actually support fractional
11661166
# milliseconds, and some error or give warnings.
1167-
interval = int(interval)
1167+
# Some backends also fail when interval == 0, so ensure >= 1 msec
1168+
interval = max(int(interval), 1)
11681169
self._interval = interval
11691170
self._timer_set_interval()
11701171

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.