From: <cg...@us...> - 2007-07-21 05:44:00
|
Revision: 3334 http://svn.sourceforge.net/jython/?rev=3334&view=rev Author: cgroves Date: 2007-07-20 22:43:54 -0700 (Fri, 20 Jul 2007) Log Message: ----------- use cpython_compatible_select in place of select to fix the last of bug #1755096. Modified Paths: -------------- trunk/jython/Lib/telnetlib.py Modified: trunk/jython/Lib/telnetlib.py =================================================================== --- trunk/jython/Lib/telnetlib.py 2007-07-21 05:40:11 UTC (rev 3333) +++ trunk/jython/Lib/telnetlib.py 2007-07-21 05:43:54 UTC (rev 3334) @@ -36,8 +36,15 @@ # Imported modules import sys import socket -import select +import os +if os.name == 'java': + from select import cpython_compatible_select as select +else: + from select import select +del os + + __all__ = ["Telnet"] # Tunable parameters @@ -311,7 +318,7 @@ s_args = s_reply if timeout is not None: s_args = s_args + (timeout,) - while not self.eof and select.select(*s_args) == s_reply: + while not self.eof and select(*s_args) == s_reply: i = max(0, len(self.cookedq)-n) self.fill_rawq() self.process_rawq() @@ -525,7 +532,7 @@ def sock_avail(self): """Test whether data is available on the socket.""" - return select.select([self], [], [], 0) == ([self], [], []) + return select([self], [], [], 0) == ([self], [], []) def interact(self): """Interaction function, emulates a very dumb telnet client.""" @@ -533,7 +540,7 @@ self.mt_interact() return while 1: - rfd, wfd, xfd = select.select([self, sys.stdin], [], []) + rfd, wfd, xfd = select([self, sys.stdin], [], []) if self in rfd: try: text = self.read_eager() @@ -613,7 +620,7 @@ if self.eof: break if timeout is not None: - r, w, x = select.select([self.fileno()], [], [], timeout) + r, w, x = select([self.fileno()], [], [], timeout) if not r: break self.fill_rawq() This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |