Remove unused py27 socketpair/makefile workaround
Python2.7 has a bug that means the sockets returned from socketpair() are not wrapped in the usual socket.socket class, and contain a broken makefile() method. This was important a long time ago when privsep used file operations (and sock.makefile()) for communication. Privsep now uses socket operations directly, and never calls makefile() on the communication socket. Further, the workaround breaks on py34 where the socket classes are completely different (and don't have the original issue). Well past time for the workaround to be removed and forgotten. Change-Id: Id6395b8497b9f5449893e17d07fc4b664ee041ce
This commit is contained in:
parent
54e2d2f7f5
commit
79ab8a755c
|
@ -227,14 +227,6 @@ class ForkingClientChannel(_ClientChannel):
|
|||
|
||||
sock_a, sock_b = socket.socketpair()
|
||||
|
||||
# Python bug workaround. It seems socketpair sockets aren't
|
||||
# wrapped in the same way as socket.socket return values are. The
|
||||
# unwrapped socket object in py27 contains a broken .makefile
|
||||
# implementation (tries to seek).
|
||||
if not isinstance(sock_a, socket.SocketType):
|
||||
sock_a = socket.SocketType(_sock=sock_a)
|
||||
sock_b = socket.SocketType(_sock=sock_b)
|
||||
|
||||
for s in (sock_a, sock_b):
|
||||
s.setblocking(True)
|
||||
# Important that these sockets don't get leaked
|
||||
|
|
Loading…
Reference in New Issue