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
vanhempi e2481b19a2
commit ad570ec027
No known key found for this signature in database
GPG avaimen ID: 063938BA42CFA724

Näytä tiedosto

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