User Tools

Site Tools


notes:python_process_poller

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
notes:python_process_poller [2013/07/22 12:29]
andy
notes:python_process_poller [2013/07/22 12:32]
andy
Line 28: Line 28:
         self.__closed_procs = set()         self.__closed_procs = set()
         self.__poller = select.poll()         self.__poller = select.poll()
 +        ​
 +        ​
 +    def __del__(self):​
 +        for context, proc_list in self.__procs.iteritems():​
 +            try:
 +                proc_list[0].kill()
 +                proc_list[0].wait()
 +            except Exception:
 +                pass
  
  
Line 197: Line 206:
         """​Buffer up output."""​         """​Buffer up output."""​
  
-        index = 1 if stderr ​else 0+        index = 1 if is_stderr ​else 0
         self.output[context][index] += data         self.output[context][index] += data
         return False         return False
notes/python_process_poller.txt ยท Last modified: 2013/07/22 12:32 by andy