[Python-checkins] python/dist/src/Lib socket.py,1.35,1.36

montanaro@users.sourceforge.net montanaro@users.sourceforge.net
Sat, 29 Mar 2003 20:54:26 -0800


Update of /cvsroot/python/python/dist/src/Lib
In directory sc8-pr-cvs1:/tmp/cvs-serv14763/Lib

Modified Files:
	socket.py 
Log Message:
The socket module now always uses the _socketobject wrapper class, even on
platforms which have dup(2).  The makefile() method is built directly on top
of the socket without duplicating the file descriptor, allowing timeouts to
work properly.  Includes a new test case (urllibnet) which requires the
network resource.

Closes bug 707074.



Index: socket.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Lib/socket.py,v
retrieving revision 1.35
retrieving revision 1.36
diff -C2 -d -r1.35 -r1.36
*** socket.py	22 Aug 2002 17:31:16 -0000	1.35
--- socket.py	30 Mar 2003 04:54:23 -0000	1.36
***************
*** 60,70 ****
  
  _realsocket = socket
- _needwrapper = False
  if (sys.platform.lower().startswith("win")
      or (hasattr(os, 'uname') and os.uname()[0] == "BeOS")
      or sys.platform=="riscos"):
  
-     _needwrapper = True
- 
      if _have_ssl:
          _realssl = ssl
--- 60,67 ----
***************
*** 181,186 ****
      del _m, _s
  
! if _needwrapper:
!     socket = SocketType = _socketobject
  
  class _fileobject(object):
--- 178,182 ----
      del _m, _s
  
! socket = SocketType = _socketobject
  
  class _fileobject(object):