#NEWLINE# def reap_processes( self ) : #NEWLINE# #INDENT# watchers_pids = { #NEWLINE# #INDENT# #NEWLINE# #UNINDENT# } #NEWLINE# for watcher in self . iter_watchers ( ) : #NEWLINE# #INDENT# if ( not watcher . is_stopped ( ) ) : #NEWLINE# #INDENT# for process in watcher . processes . values ( ) : #NEWLINE# #INDENT# watchers_pids [ process . pid ] = pid #NEWLINE# #UNINDENT# #UNINDENT# #UNINDENT# if ( not IS_WINDOWS ) : #NEWLINE# #INDENT# while True : #NEWLINE# #INDENT# try : #NEWLINE# #INDENT# ( pid , status ) = os . waitpid ( ( - 1 ) , os . WNOHANG ) #NEWLINE# if ( not pid ) : #NEWLINE# #INDENT# break #NEWLINE# #UNINDENT# if ( pid in watchers_pids ) : #NEWLINE# #INDENT# watcher = watchers_pids [ pid ] #NEWLINE# watcher . reap_process ( pid , status ) #NEWLINE# #UNINDENT# #UNINDENT# except OSError as e : #NEWLINE# #INDENT# if ( e . errno == errno . EAGAIN ) : #NEWLINE# #INDENT# sleep ( 0 ) #NEWLINE# continue #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if ( e . errno == errno . ECHILD ) : #NEWLINE# #INDENT# return #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# raise