summaryrefslogtreecommitdiffstats
path: root/Lib/socket.py
diff options
context:
space:
mode:
authorSkip Montanaro <skip@pobox.com>2003-03-30 04:54:24 (GMT)
committerSkip Montanaro <skip@pobox.com>2003-03-30 04:54:24 (GMT)
commit89feabc7f5308e3190909f47fce225df28a65062 (patch)
treead1126c669f70a2138f8449453426d298d439a3c /Lib/socket.py
parenta942b9931c9ef13f7baf82c12e4ee312e6906f1c (diff)
downloadcpython-89feabc7f5308e3190909f47fce225df28a65062.zip
cpython-89feabc7f5308e3190909f47fce225df28a65062.tar.gz
cpython-89feabc7f5308e3190909f47fce225df28a65062.tar.bz2
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.
Diffstat (limited to 'Lib/socket.py')
-rw-r--r--Lib/socket.py6
1 files changed, 1 insertions, 5 deletions
diff --git a/Lib/socket.py b/Lib/socket.py
index a8a4e39..cb0181b 100644
--- a/Lib/socket.py
+++ b/Lib/socket.py
@@ -59,13 +59,10 @@ if _have_ssl:
__all__.extend(os._get_exports_list(_ssl))
_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
def ssl(sock, keyfile=None, certfile=None):
@@ -180,8 +177,7 @@ class _socketobject(object):
exec _s % (_m, _m, _m, _m)
del _m, _s
-if _needwrapper:
- socket = SocketType = _socketobject
+socket = SocketType = _socketobject
class _fileobject(object):
"""Faux file object attached to a socket object."""