From: Ben Pfaff Date: Tue, 23 Aug 2011 18:16:57 +0000 (-0700) Subject: ovs.stream: Simplify logic in Stream.wait(). X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=8ba31bf16d03c449fbf40ec00d9a816b4ec05018;p=openvswitch ovs.stream: Simplify logic in Stream.wait(). Suggested-by: Reid Price --- diff --git a/python/ovs/stream.py b/python/ovs/stream.py index 5954c314..82d4557e 100644 --- a/python/ovs/stream.py +++ b/python/ovs/stream.py @@ -206,10 +206,10 @@ class Stream(object): if self.state == Stream.__S_CONNECTING: wait = Stream.W_CONNECT - if wait in (Stream.W_CONNECT, Stream.W_SEND): - poller.fd_wait(self.socket, select.POLLOUT) - else: + if wait == Stream.W_RECV: poller.fd_wait(self.socket, select.POLLIN) + else: + poller.fd_wait(self.socket, select.POLLOUT) def connect_wait(self, poller): self.wait(poller, Stream.W_CONNECT)