diff --git a/lib/matplotlib/backend_bases.py b/lib/matplotlib/backend_bases.py index 88f74c57b2ef..6b4182f326da 100644 --- a/lib/matplotlib/backend_bases.py +++ b/lib/matplotlib/backend_bases.py @@ -2316,7 +2316,7 @@ def start_event_loop(self, timeout=0): The event loop blocks until a callback function triggers `stop_event_loop`, or *timeout* is reached. - If *timeout* is negative, never timeout. + If *timeout* is 0 or negative, never timeout. Only interactive backends need to reimplement this method and it relies on `flush_events` being properly implemented. diff --git a/lib/matplotlib/backends/backend_qt5.py b/lib/matplotlib/backends/backend_qt5.py index 24f0c24fc02a..27c23435f87b 100644 --- a/lib/matplotlib/backends/backend_qt5.py +++ b/lib/matplotlib/backends/backend_qt5.py @@ -426,7 +426,7 @@ def start_event_loop(self, timeout=0): if hasattr(self, "_event_loop") and self._event_loop.isRunning(): raise RuntimeError("Event loop already running") self._event_loop = event_loop = QtCore.QEventLoop() - if timeout: + if timeout > 0: timer = QtCore.QTimer.singleShot(timeout * 1000, event_loop.quit) event_loop.exec_()