mirror of
https://github.com/openvswitch/ovs
synced 2025-09-04 08:15:25 +00:00
python: Don't compare None and int.
Comparing None to an integer worked in Python 2, but fails in Python 3. Signed-off-by: Russell Bryant <russell@ovn.org> Acked-by: Ben Pfaff <blp@ovn.org>
This commit is contained in:
@@ -518,7 +518,7 @@ class Reconnect(object):
|
|||||||
"""Causes the next call to poller.block() to wake up when self.run()
|
"""Causes the next call to poller.block() to wake up when self.run()
|
||||||
should be called."""
|
should be called."""
|
||||||
timeout = self.timeout(now)
|
timeout = self.timeout(now)
|
||||||
if timeout >= 0:
|
if timeout is not None and timeout >= 0:
|
||||||
poller.timer_wait(timeout)
|
poller.timer_wait(timeout)
|
||||||
|
|
||||||
def timeout(self, now):
|
def timeout(self, now):
|
||||||
|
@@ -93,7 +93,7 @@ def do_advance(arg):
|
|||||||
def do_timeout(_):
|
def do_timeout(_):
|
||||||
global now
|
global now
|
||||||
timeout = r.timeout(now)
|
timeout = r.timeout(now)
|
||||||
if timeout >= 0:
|
if timeout is not None and timeout >= 0:
|
||||||
print(" advance %d ms" % timeout)
|
print(" advance %d ms" % timeout)
|
||||||
now += timeout
|
now += timeout
|
||||||
else:
|
else:
|
||||||
|
Reference in New Issue
Block a user