Handle malformed UTF-8 output in test runner.

Thanks, Michel!
This commit is contained in:
Bob Nystrom 2015-03-14 08:47:31 -07:00
parent f7849244a8
commit db9e5737f6

View File

@ -151,8 +151,12 @@ def run_test(path):
# Invoke wren and run the test.
proc = Popen([WREN_APP, path], stdin=PIPE, stdout=PIPE, stderr=PIPE)
(out, err) = proc.communicate(input_bytes)
out = out.decode("utf-8").replace('\r\n', '\n')
err = err.decode("utf-8").replace('\r\n', '\n')
try:
out = out.decode("utf-8").replace('\r\n', '\n')
err = err.decode("utf-8").replace('\r\n', '\n')
except:
fails.append('Error decoding output.')
fails = []