def obedient_process(*args, **kwargs):
 stopped = []
 def handler(sig, frame):
  send('SIGINT')
  stopped.append(1)
 signal.signal(signal.SIGINT, handler)
 send('STARTED')
 while (not stopped):
  signal.pause()
 send('STOPPED')

def obedient_process ( * args , ** kwargs ) : stopped = [ ] def handler ( sig , frame ) : send ( 'SIGINT' ) stopped . append ( 1 ) signal . signal ( signal . SIGINT , handler ) send ( 'STARTED' ) while ( not stopped ) : signal . pause ( ) send ( 'STOPPED' )
waits for sigint and exits normally .