aboutsummaryrefslogtreecommitdiffstats
path: root/python/servo
diff options
context:
space:
mode:
authorSimon Sapin <simon.sapin@exyr.org>2019-12-03 17:55:51 +0100
committerSimon Sapin <simon.sapin@exyr.org>2019-12-03 17:55:51 +0100
commit14f049ddd1ff0801f12f7a2781a2caaaa5b9e81f (patch)
tree5f63a679b52499feb48fb4787a9146053b6e96a5 /python/servo
parentf0b970d90d3050258cf7d4569f63794fa08eb240 (diff)
downloadservo-14f049ddd1ff0801f12f7a2781a2caaaa5b9e81f.tar.gz
servo-14f049ddd1ff0801f12f7a2781a2caaaa5b9e81f.zip
Fix Python Unicode error on macOS CI
Diffstat (limited to 'python/servo')
-rw-r--r--python/servo/testing_commands.py9
1 files changed, 6 insertions, 3 deletions
diff --git a/python/servo/testing_commands.py b/python/servo/testing_commands.py
index 710924669c9..01cdc14db30 100644
--- a/python/servo/testing_commands.py
+++ b/python/servo/testing_commands.py
@@ -563,9 +563,12 @@ class MachCommands(CommandBase):
else:
actual_failures.append(failure["output"])
- def format(outputs, description, file=sys.stdout):
- print(len(outputs), description + ":\n", file=file)
- file.write('\n'.join(outputs).encode("utf-8"))
+ def format(outputs, description, file=None):
+ formatted = "%s %s:\n%s" % (len(outputs), description, "\n".join(outputs))
+ if file:
+ file.write(formatted.encode("utf-8"))
+ else:
+ print(formatted)
if log_intermittents:
with open(log_intermittents, "wb") as file: