diff options
author | Douglas Bagnall <douglas.bagnall@catalyst.net.nz> | 2018-12-12 10:17:38 +1300 |
---|---|---|
committer | Andrew Bartlett <abartlet@samba.org> | 2018-12-12 04:38:13 +0100 |
commit | 25ab429371f7cd4d4cd572d843d3607f2ce1db6f (patch) | |
tree | 12b4d750ef203b6550f9eaa83c23347306616d64 /script/autobuild.py | |
parent | 8d333f43055daf5e18623f2ad9e379f58ef5f8cd (diff) | |
download | samba-25ab429371f7cd4d4cd572d843d3607f2ce1db6f.tar.gz |
autobuild: py3: cope with bytes when compiling system-info.txt
The command output looks like b'foo\nbar' in string-space.
Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Diffstat (limited to 'script/autobuild.py')
-rwxr-xr-x | script/autobuild.py | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/script/autobuild.py b/script/autobuild.py index c71b85a85b4..f26a5b2095e 100755 --- a/script/autobuild.py +++ b/script/autobuild.py @@ -608,10 +608,15 @@ class buildlist(object): def write_system_info(self): filename = 'system-info.txt' f = open(filename, 'w') - for cmd in ['uname -a', 'free', 'cat /proc/cpuinfo', - 'cc --version', 'df -m .', 'df -m %s' % testbase]: + for cmd in ['uname -a', + 'free', + 'cat /proc/cpuinfo', + 'cc --version', + 'df -m .', + 'df -m %s' % testbase]: + out = run_cmd(cmd, output=True, checkfail=False) print('### %s' % cmd, file=f) - print(run_cmd(cmd, output=True, checkfail=False), file=f) + print(out.decode('utf8', 'backslashreplace'), file=f) print(file=f) f.close() return filename |