Fix utf-8 encoding err

This commit is contained in:
boqiu 2024-09-05 15:25:53 +08:00
parent 9028a30e9d
commit 7ef1a73c7c

View File

@ -50,7 +50,11 @@ def run_single_test(py, script, test_dir, index, port_min, port_max):
)
except subprocess.CalledProcessError as err:
print_testcase_result(RED, CROSS, script, start_time)
print("Output of " + script + "\n" + err.output.decode("utf-8"), flush=True)
try:
print("Output of " + script + "\n" + err.output.decode("utf-8"), flush=True)
except UnicodeDecodeError:
print("Output of " + script + "\n", flush=True)
print(err.output)
raise err
print_testcase_result(BLUE, TICK, script, start_time)