diff --git a/python/ovs/reconnect.py b/python/ovs/reconnect.py index 39dd556da..d4f59518f 100644 --- a/python/ovs/reconnect.py +++ b/python/ovs/reconnect.py @@ -518,7 +518,7 @@ class Reconnect(object): """Causes the next call to poller.block() to wake up when self.run() should be called.""" timeout = self.timeout(now) - if timeout >= 0: + if timeout is not None and timeout >= 0: poller.timer_wait(timeout) def timeout(self, now): diff --git a/tests/test-reconnect.py b/tests/test-reconnect.py index e291e3435..8132fd925 100644 --- a/tests/test-reconnect.py +++ b/tests/test-reconnect.py @@ -93,7 +93,7 @@ def do_advance(arg): def do_timeout(_): global now timeout = r.timeout(now) - if timeout >= 0: + if timeout is not None and timeout >= 0: print(" advance %d ms" % timeout) now += timeout else: