2b4ae91b02d0b3b42e2a634c4f432df6d20d3b7c,lib/gui/wrapper.py,FaceswapControl,terminate,#FaceswapControl#,254

Before Change


                print("Killed")
        else:
            print("Terminating Process...")
            try:
                self.process.terminate()
                self.process.wait(timeout=10)
                print("Terminated")
            except TimeoutExpired:
                print("Termination timed out. Killing Process...")
                self.process.kill()
                print("Killed")

    def set_final_status(self, returncode):
         Set the status bar output based on subprocess return code 
        if returncode == 0 or returncode == 3221225786:
            status = "Ready"

After Change


            for child in alive:
                child.kill()
            _, alive = psutil.wait_procs(alive, timeout=10)
            if not alive:
                print("Killed")
            else:
                for child in alive:
                    print("Process {} survived SIGKILL. "
                          "Giving up".format(child))

    def set_final_status(self, returncode):
         Set the status bar output based on subprocess return code 
        if returncode in (0, 3221225786):
            status = "Ready"
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 4

Instances


Project Name: deepfakes/faceswap
Commit Name: 2b4ae91b02d0b3b42e2a634c4f432df6d20d3b7c
Time: 2018-11-04
Author: 36920800+torzdf@users.noreply.github.com
File Name: lib/gui/wrapper.py
Class Name: FaceswapControl
Method Name: terminate


Project Name: pantsbuild/pants
Commit Name: fd1456ac36e0a1ebfb800c9593f1540858ca7bea
Time: 2015-07-17
Author: kwilson@twopensource.com
File Name: src/python/pants/backend/core/tasks/reporting_server.py
Class Name: KillServer
Method Name: execute


Project Name: deepdrive/deepdrive
Commit Name: e3464f7cfc09a5d909776386481a17f345bf9111
Time: 2018-11-20
Author: cquiter@gmail.com
File Name: sim/gym_env.py
Class Name: DeepDriveEnv
Method Name: close_sim