Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions reframe/utility/os_ext.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,17 +21,17 @@
def run_command(cmd, check=False, timeout=None, shell=False):
try:
proc = run_command_async(cmd, shell=shell, start_new_session=True)
proc.wait(timeout=timeout)
proc_stdout, proc_stderr = proc.communicate(timeout=timeout)
except subprocess.TimeoutExpired as e:
os.killpg(proc.pid, signal.SIGKILL)
raise SpawnedProcessTimeout(e.cmd,
proc.stdout.read(),
proc.stderr.read(), timeout) from None
proc.stdout,
proc.stderr, timeout) from None

completed = subprocess.CompletedProcess(args=shlex.split(cmd),
returncode=proc.returncode,
stdout=proc.stdout.read(),
stderr=proc.stderr.read())
stdout=proc_stdout,
stderr=proc_stderr)

if check and proc.returncode != 0:
raise SpawnedProcessError(completed.args,
Expand Down