On Fri, Jan 22, 2016 at 09:32:31PM -0500, Russell Bryant wrote:
> Comparing None to an integer worked in Python 2, but fails in Python 3.
>
> Signed-off-by: Russell Bryant <[email protected]>
> ---
> python/ovs/reconnect.py | 2 +-
> tests/test-reconnect.py | 2 +-
> 2 files changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/python/ovs/reconnect.py b/python/ovs/reconnect.py
> index 39dd556..d4f5951 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)
I think that self.timeout() always either returns None or a nonnegative
value, so that you can just change this to:
if timeout is not None:
Of course, the way you wrote it works too.
Acked-by: Ben Pfaff <[email protected]>
_______________________________________________
dev mailing list
[email protected]
http://openvswitch.org/mailman/listinfo/dev