Skip to content
Snippets Groups Projects
Commit c9861fd5 authored by ale's avatar ale
Browse files

Replace subprocess.run with Python 2 equivalent

parent 84d1a59d
No related branches found
No related tags found
No related merge requests found
......@@ -34,13 +34,11 @@ mm_env['LC_ALL'] = 'C'
def _run(cmd):
app.logger.info('running %s', cmd)
try:
subprocess.run(
cmd, check=True, env=mm_env,
stdout=subprocess.PIPE,
stderr=subprocess.STDOUT)
stderr = subprocess.check_output(
cmd, env=mm_env, stderr=subprocess.STDOUT)
except subprocess.CalledProcessError as e:
app.logger.error('command FAILED (status=%d), output:\n%s\n',
e.returncode, e.stdout.decode('utf-8'))
e.returncode, stderr.decode('utf-8'))
raise
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment