Skip to content

Commit

Permalink
python: Don't compare None and int.
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
russellb committed Feb 2, 2016
1 parent da2d45c commit c03afda
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion python/ovs/reconnect.py
Expand Up @@ -518,7 +518,7 @@ def wait(self, poller, now):
"""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):
Expand Down
2 changes: 1 addition & 1 deletion tests/test-reconnect.py
Expand Up @@ -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:
Expand Down

0 comments on commit c03afda

Please sign in to comment.