Commit 1d8a7e59 authored by Denis Bilenko's avatar Denis Bilenko

socket: fix bug in dup() - it did not inherit 'timeout' of the original...

socket: fix bug in dup() - it did not inherit 'timeout' of the original socket; bug introduced in 0.12.0
parent 845157c0
......@@ -314,7 +314,9 @@ class socket(object):
"""dup() -> socket object
Return a new socket object connected to the same system resource."""
return socket(_sock=self._sock)
new_sock = socket(_sock=self._sock)
new_sock.timeout = self.timeout
return new_sock
def makefile(self, mode='r', bufsize=-1):
return _fileobject(self.dup(), mode, bufsize)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment