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

Skip to content

Commit 4fb5993

Browse files
committed
FIX: handle negative timeouts in backend_qt's start_event_loop
negative numbers are truthy, only start timer on positive timeouts.
1 parent 0eb2172 commit 4fb5993

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

lib/matplotlib/backends/backend_qt5.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -426,7 +426,7 @@ def start_event_loop(self, timeout=0):
426426
if hasattr(self, "_event_loop") and self._event_loop.isRunning():
427427
raise RuntimeError("Event loop already running")
428428
self._event_loop = event_loop = QtCore.QEventLoop()
429-
if timeout:
429+
if timeout > 0:
430430
timer = QtCore.QTimer.singleShot(timeout * 1000, event_loop.quit)
431431
event_loop.exec_()
432432

0 commit comments

Comments
 (0)