src/tests/api/t_progress.py
branchs11u2-sru
changeset 3240 3661c0b9accd
parent 2758 ff2b3e357cac
child 3158 58c9c2c21e67
equal deleted inserted replaced
3239:17c6a7f6624f 3240:3661c0b9accd
   334                         mt.reset()
   334                         mt.reset()
   335 
   335 
   336         def __t_pty_tracker(self, trackerclass, **kwargs):
   336         def __t_pty_tracker(self, trackerclass, **kwargs):
   337                 def __drain(masterf):
   337                 def __drain(masterf):
   338                         while True:
   338                         while True:
   339                                 termdata = masterf.read(1024)
   339                                 chunksz = 1024
   340                                 if len(termdata) == 0:
   340                                 termdata = masterf.read(chunksz)
       
   341                                 if len(termdata) < chunksz:
       
   342                                         # assume we hit EOF
   341                                         break
   343                                         break
   342 
   344 
   343                 #
   345                 #
   344                 # - Allocate a pty
   346                 # - Allocate a pty
   345                 # - Create a thread to drain off the master side; without
   347                 # - Create a thread to drain off the master side; without