def test_kill(self): sproc = test_func.get_test_subprocess() test_pid = sproc.pid p = psutil.Process(test_pid) kill_process.kill_child_processes(test_pid) p.wait() self.assertFalse(psutil.pid_exists(test_pid))
try: bID = int(sys.argv[3]) except (IndexError, ValueError): bID = 0 savechat.runMain('pull', str(args.target), bID) # elif args.wlocation: # loactionfinder.finder(args.target) async def main(): print_logo("wplay") args = get_arguments() try: await match_args(args) sys.exit(0) except KeyboardInterrupt: sys.exit(0) try: asyncio.get_event_loop().run_until_complete(main()) except AssertionError: try: for task in asyncio.all_tasks(): task.cancel() except RuntimeError: exit() exit() finally: kill_process.kill_child_processes(os.getpid())