Commit 5aa878c6 authored by Antoine Pitrou's avatar Antoine Pitrou

os.dup()-then-close() can be replaced with detach()

parent 2341f9ba
...@@ -469,10 +469,8 @@ if sys.platform != 'win32': ...@@ -469,10 +469,8 @@ if sys.platform != 'win32':
''' '''
if duplex: if duplex:
s1, s2 = socket.socketpair() s1, s2 = socket.socketpair()
c1 = Connection(os.dup(s1.fileno())) c1 = Connection(s1.detach())
c2 = Connection(os.dup(s2.fileno())) c2 = Connection(s2.detach())
s1.close()
s2.close()
else: else:
fd1, fd2 = os.pipe() fd1, fd2 = os.pipe()
c1 = Connection(fd1, writable=False) c1 = Connection(fd1, writable=False)
......
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