handle None in output
This commit is contained in:
parent
30e714bbe5
commit
c0d99a7e99
|
@ -136,10 +136,10 @@ def output(cmd, print_output=False, exit_on_error=True):
|
|||
stderr=subprocess.STDOUT,
|
||||
shell=True)
|
||||
except subprocess.CalledProcessError as e:
|
||||
sys.stderr.write(e.output)
|
||||
if e.output:
|
||||
sys.stderr.write(e.output.decode('utf-8'))
|
||||
if exit_on_error:
|
||||
error(cmd)
|
||||
if print_output:
|
||||
print(output)
|
||||
return output.decode('utf-8')
|
||||
|
||||
return output.decode('utf-8') if output else None
|
||||
|
|
Loading…
Reference in New Issue