From: <pj...@us...> - 2009-10-27 22:22:21
|
Revision: 6918 http://jython.svn.sourceforge.net/jython/?rev=6918&view=rev Author: pjenvey Date: 2009-10-27 22:21:57 +0000 (Tue, 27 Oct 2009) Log Message: ----------- has_key -> in, etc Modified Paths: -------------- trunk/jython/Lib/select.py trunk/jython/Lib/socket.py Modified: trunk/jython/Lib/select.py =================================================================== --- trunk/jython/Lib/select.py 2009-10-27 22:16:17 UTC (rev 6917) +++ trunk/jython/Lib/select.py 2009-10-27 22:21:57 UTC (rev 6918) @@ -117,7 +117,7 @@ else: try: timeout = int(timeout) - if timeout == 0: + if not timeout: self.selector.selectNow() else: # No multiplication required: both cpython and java use millisecond timeouts @@ -224,7 +224,7 @@ registered_for_read[fd] = 1 # And now the write list for fd in write_fd_list: - if registered_for_read.has_key(fd): + if fd in registered_for_read: # registering a second time overwrites the first pobj.register(fd, POLLIN|POLLOUT) else: Modified: trunk/jython/Lib/socket.py =================================================================== --- trunk/jython/Lib/socket.py 2009-10-27 22:16:17 UTC (rev 6917) +++ trunk/jython/Lib/socket.py 2009-10-27 22:21:57 UTC (rev 6918) @@ -259,7 +259,7 @@ self.jsocket.setSoTimeout(self._timeout_millis) def getsockopt(self, level, option): - if self.options.has_key( (level, option) ): + if (level, option) in self.options: result = getattr(self.jsocket, "get%s" % self.options[ (level, option) ])() if option == SO_LINGER: if result == -1: @@ -272,7 +272,7 @@ raise error(errno.ENOPROTOOPT, "Socket option '%s' (level '%s') not supported on socket(%s)" % (_constant_to_name(option), _constant_to_name(level), str(self.jsocket))) def setsockopt(self, level, option, value): - if self.options.has_key( (level, option) ): + if (level, option) in self.options: if option == SO_LINGER: values = struct.unpack('ii', value) self.jsocket.setSoLinger(*values) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |