Commit be8c879a authored by Denis Bilenko's avatar Denis Bilenko

revert 1003:714c59c30efe: socket.dup() is not supposed to inherit the timeout

parent b3b4e30a
...@@ -312,12 +312,13 @@ class socket(object): ...@@ -312,12 +312,13 @@ class socket(object):
def dup(self): def dup(self):
"""dup() -> socket object """dup() -> socket object
Return a new socket object connected to the same system resource.""" Return a new socket object connected to the same system resource.
new_sock = socket(_sock=self._sock) Note, that the new socket does not inherit the timeout."""
new_sock.timeout = self.timeout return socket(_sock=self._sock)
return new_sock
def makefile(self, mode='r', bufsize=-1): def makefile(self, mode='r', bufsize=-1):
# note that this does not inherit timeout either (intentionally, because that's
# how the standard socket behaves)
return _fileobject(self.dup(), mode, bufsize) return _fileobject(self.dup(), mode, bufsize)
def recv(self, *args): def recv(self, *args):
......
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