Convert bytes to str in the output of run

This commit is contained in:
cmdr2 2022-10-10 19:50:43 +05:30
parent a6913dfe29
commit 3cf7a984fd

View File

@ -20,6 +20,9 @@ def run(cmd, run_in_folder=None, env=None, get_output=False, log_the_cmd=False):
out, err = p.communicate()
out = out.decode('utf-8') if isinstance(out, bytes) else out
err = err.decode('utf-8') if isinstance(out, bytes) else err
if get_output:
return out, err