tools: make print_table compatible with python2 and python3 tests

StringIO expect 'str' object, but on python2 it's different from
'unicode' (returned by decode() method). Convert it explicitly back to
str.
This commit is contained in:
Marek Marczykowski-Górecki 2017-03-12 00:45:44 +01:00
parent e2481b19a2
commit ad570ec027
No known key found for this signature in database
GPG Key ID: 063938BA42CFA724

View File

@ -474,7 +474,7 @@ def print_table(table, stream=None):
stdout=subprocess.PIPE)
p.stdin.write(text_table.encode())
(out, _) = p.communicate()
stream.write(out.decode())
stream.write(str(out.decode()))
else:
p = subprocess.Popen(cmd, stdin=subprocess.PIPE)
p.communicate(text_table.encode())