3c877e3dd3fb64d737a4b9782c6d4549b00e26d1,src/sos/hosts.py,LocalHost,run_command,#LocalHost#Any#Any#Any#,219

Before Change


        // run command but does not wait for result.
        if realtime:
            import pexpect
            try:
                if isinstance(cmd, str):
                    child = pexpect.spawn(cmd, timeout=None)
                else:
                    child = pexpect.spawn(subprocess.list2cmdline(cmd), timeout=None)
                while True:
                    try:
                        child.expect("\n")
                        if env.verbosity > 0:
                            sys.stdout.write(child.before.decode() + "\n")
                    except pexpect.EOF:
                        break
                child.wait()
                child.close()
                return child.exitstatus
            except Exception as e:
                sys.stderr.write(str(e))
                return 1
        elif wait_for_task or sys.platform == "win32":
            return subprocess.Popen(cmd, shell=True, **kwargs)
        else:
            p = DaemonizedProcess(cmd, **kwargs)

After Change


        // run command but does not wait for result.
        if realtime:
            from .utils import pexpect_run
            return pexpect_run(cmd)
        elif wait_for_task or sys.platform == "win32":
            return subprocess.Popen(cmd, shell=True, **kwargs)
        else:
            p = DaemonizedProcess(cmd, **kwargs)
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 25

Instances


Project Name: vatlab/SoS
Commit Name: 3c877e3dd3fb64d737a4b9782c6d4549b00e26d1
Time: 2017-08-01
Author: BPeng1@BCBW31517465254.mdanderson.edu
File Name: src/sos/hosts.py
Class Name: LocalHost
Method Name: run_command


Project Name: vatlab/SoS
Commit Name: 3c877e3dd3fb64d737a4b9782c6d4549b00e26d1
Time: 2017-08-01
Author: BPeng1@BCBW31517465254.mdanderson.edu
File Name: src/sos/actions.py
Class Name: SoS_ExecuteScript
Method Name: run


Project Name: vatlab/SoS
Commit Name: 3c877e3dd3fb64d737a4b9782c6d4549b00e26d1
Time: 2017-08-01
Author: BPeng1@BCBW31517465254.mdanderson.edu
File Name: src/sos/hosts.py
Class Name: RemoteHost
Method Name: run_command


Project Name: vatlab/SoS
Commit Name: 3c877e3dd3fb64d737a4b9782c6d4549b00e26d1
Time: 2017-08-01
Author: BPeng1@BCBW31517465254.mdanderson.edu
File Name: src/sos/hosts.py
Class Name: LocalHost
Method Name: run_command