@@ -97,17 +97,19 @@ def connect_to_new_process(self, fds):
9797 resource_tracker .getfd ()]
9898 allfds += fds
9999 try :
100- if self ._forkserver_authkey :
101- client .setblocking (True )
102- wrapped_client = connection .Connection (client .fileno ())
103- try :
104- connection .answer_challenge (
105- wrapped_client , self ._forkserver_authkey )
106- connection .deliver_challenge (
107- wrapped_client , self ._forkserver_authkey )
108- finally :
109- wrapped_client ._detach ()
110- del wrapped_client
100+ assert self ._forkserver_authkey
101+ client .setblocking (True )
102+ wrapped_client = connection .Connection (client .fileno ())
103+ # The other side of this exchange happens in the child as
104+ # implemented in main().
105+ try :
106+ connection .answer_challenge (
107+ wrapped_client , self ._forkserver_authkey )
108+ connection .deliver_challenge (
109+ wrapped_client , self ._forkserver_authkey )
110+ finally :
111+ wrapped_client ._detach ()
112+ del wrapped_client
111113 reduction .sendfds (client , allfds )
112114 return parent_r , parent_w
113115 except :
@@ -296,6 +298,8 @@ def sigchld_handler(*_unused):
296298 try :
297299 if authkey :
298300 wrapped_s = connection .Connection (s .fileno ())
301+ # The other side of this exchange happens in
302+ # in connect_to_new_process().
299303 try :
300304 connection .deliver_challenge (
301305 wrapped_s , authkey )
0 commit comments