Skip to content

Commit

Permalink
Replace six.ensure_str with just .decode() for screenshot decoding
Browse files Browse the repository at this point in the history
Part of #28776.

See also #28929.
  • Loading branch information
foolip committed May 10, 2021
1 parent 70f4ba3 commit 5b6bf28
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions tools/wptrunner/wptrunner/executors/executorservo.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
import threading
import traceback
import uuid
from six import ensure_str

from mozprocess import ProcessHandler

Expand Down Expand Up @@ -263,7 +262,9 @@ def screenshot(self, test, viewport_size, dpi, page_ranges):
with open(output_path, "rb") as f:
# Might need to strip variable headers or something here
data = f.read()
return True, [ensure_str(base64.b64encode(data))]
# Returning the screenshot as a string could potentially be avoided,
# see https://github.com/web-platform-tests/wpt/issues/28929.
return True, [base64.b64encode(data).decode()]

def do_test(self, test):
result = self.implementation.run_test(test)
Expand Down

0 comments on commit 5b6bf28

Please sign in to comment.