call site 17 for execnet.Channel.waitclose
execnet/testing/test_gateway.py - line 297
295
296
297
298
299
300
301
302
   def test_remote_redirect_stdout(self): 
       out = py.std.StringIO.StringIO() 
->     handle = self.gw._remote_redirect(stdout=out) 
       c = self.gw.remote_exec("print 42")
       c.waitclose(TESTTIMEOUT)
       handle.close() 
       s = out.getvalue() 
       assert s.strip() == "42" 
execnet/gateway.py - line 244
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
   def _remote_redirect(self, stdout=None, stderr=None): 
       """ return a handle representing a redirection of a remote 
               end's stdout to a local file object.  with handle.close() 
               the redirection will be reverted.   
           """ 
       clist = []
       for name, out in ('stdout', stdout), ('stderr', stderr): 
           if out: 
               outchannel = self.newchannel()
               outchannel.setcallback(getattr(out, 'write', out))
               channel = self.remote_exec(""" 
                       import sys
                       outchannel = channel.receive() 
                       outchannel.gateway._ThreadOut(sys, %r).setdefaultwriter(outchannel.send)
                   """ % name) 
               channel.send(outchannel)
               clist.append(channel)
       for c in clist: 
->         c.waitclose() 
       class Handle: 
           def close(_): 
               for name, out in ('stdout', stdout), ('stderr', stderr): 
                   if out: 
                       c = self.remote_exec("""
                               import sys
                               channel.gateway._ThreadOut(sys, %r).resetdefault()
                           """ % name) 
                       c.waitclose() 
       return Handle()