def kill_all():
    """When polysh quits, we kill all the remote shells we started"""
    for i in dispatchers.all_instances():
        try:
            os.kill(-i.pid, signal.SIGKILL)
        except OSError:
            # The process was already dead, no problem
            pass
def kill_all ( ) : for i in dispatchers . all_instances ( ) : try : os . kill ( - i . pid , signal . SIGKILL ) except OSError : pass
When polysh quits, we kill all the remote shells we started