

def _run_command(self, cmd, env=None):
    cwd = os.path.abspath(self.path)
    result = {
        'cmd': ' '.join(cmd),
        'cwd': cwd,
    }
    try:
        proc = subprocess.Popen(cmd, cwd=cwd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, env=env)
        (output, _) = proc.communicate()
        result['output'] = output.rstrip()
        result['returncode'] = proc.returncode
    except subprocess.CalledProcessError as e:
        result['output'] = e.output
        result['returncode'] = e.returncode
    return result

dataset/ETHPy150Open ros-infrastructure/catkin_pkg/src/catkin_pkg/changelog_generator_vcs.py VcsClientBase._run_command/original