533025215d6629a1f506838fc9eeed33f2417591,lib/gui/wrapper.py,FaceswapControl,terminate,#FaceswapControl#,335

Before Change


            logger.debug("Sending Exit Signal")
            print("Sending Exit Signal", flush=True)
            now = time()
            if os.name == "nt":
                logger.debug("Sending carriage return to process")
                con_in = win32console.GetStdHandle(  // pylint:disable=c-extension-no-member
                    win32console.STD_INPUT_HANDLE)  // pylint:disable=c-extension-no-member
                keypress = self.generate_windows_keypress("\n")
                con_in.WriteConsoleInput([keypress])
            else:
                logger.debug("Sending SIGINT to process")
                self.process.send_signal(signal.SIGINT)
            while True:
                timeelapsed = time() - now
                if self.process.poll() is not None:
                    break

After Change


        root = get_config().root
        if self.thread is None:
            logger.debug("Terminating wrapper in LongRunningTask")
            self.thread = LongRunningTask(target=self.terminate_in_thread,
                                          args=(self.command, self.process))
            self.thread.start()
            root.after(1000, self.terminate)
        elif not self.thread.complete.is_set():
            logger.debug("Not finished terminating")
            root.after(1000, self.terminate)
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 6

Instances


Project Name: deepfakes/faceswap
Commit Name: 533025215d6629a1f506838fc9eeed33f2417591
Time: 2019-06-28
Author: 36920800+torzdf@users.noreply.github.com
File Name: lib/gui/wrapper.py
Class Name: FaceswapControl
Method Name: terminate


Project Name: haotianteng/Chiron
Commit Name: cb40dd779e1f3a7ca23ea25edd03ddaca9472838
Time: 2018-04-29
Author: neven.miculinic@gmail.com
File Name: chiron/chiron_eval.py
Class Name:
Method Name: evaluation


Project Name: home-assistant/home-assistant
Commit Name: 665436cd910035b25805fa62b63f357c6eeef37e
Time: 2015-11-10
Author: leoc.git@gmail.com
File Name: homeassistant/components/light/zwave.py
Class Name: ZwaveDimmer
Method Name: _value_changed