[test] Fix printing subprocess error messages
Decode the string as Python 3 returns bytes string, and also don’t assume that it ends with a new line.
This commit is contained in:
parent
403019482b
commit
b7f1bbc2f8
@ -9,7 +9,7 @@ def cmd(command):
|
||||
p = subprocess.Popen (
|
||||
command, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
|
||||
p.wait ()
|
||||
print (p.stderr.read (), end="") # file=sys.stderr
|
||||
print (p.stderr.read ().decode ("utf-8").strip ()) # file=sys.stderr
|
||||
return p.stdout.read ().decode ("utf-8").strip (), p.returncode
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user