Skip to content

Commit

Permalink
Fixup
Browse files Browse the repository at this point in the history
  • Loading branch information
jgraham committed May 15, 2020
1 parent e7c8602 commit f9b2d22
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 9 deletions.
2 changes: 1 addition & 1 deletion tools/lint/lint.py
Original file line number Diff line number Diff line change
Expand Up @@ -652,7 +652,7 @@ def check_python_ast(repo_root, path, f):

def check_global_metadata(value):
# type: (str) -> Iterable[Tuple[Type[rules.Rule], Tuple[Any, ...]]]
global_values = {item.strip() for item in value.split(b",") if item.strip()}
global_values = {item.strip().decode("utf8") for item in value.split(b",") if item.strip()}

# TODO: this could check for duplicates and such
for global_value in global_values:
Expand Down
6 changes: 3 additions & 3 deletions tools/manifest/sourcefile.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ def replace_end(s, old, new):


def read_script_metadata(f, regexp):
# type: (BinaryIO, Pattern[bytes]) -> Iterable[Tuple[bytes, bytes]]
# type: (BinaryIO, Pattern[bytes]) -> Iterable[Tuple[Text, Text]]
"""
Yields any metadata (pairs of bytestrings) from the file-like object `f`,
as specified according to a supplied regexp.
Expand Down Expand Up @@ -84,7 +84,7 @@ def read_script_metadata(f, regexp):


def get_any_variants(item):
# type: (bytes) -> Set[bytes]
# type: (Text) -> Set[Text]
"""
Returns a set of variants (bytestrings) defined by the given keyword.
"""
Expand All @@ -98,7 +98,7 @@ def get_any_variants(item):


def get_default_any_variants():
# type: () -> Set[bytes]
# type: () -> Set[Text]
"""
Returns a set of variants (bytestrings) that will be used by default.
"""
Expand Down
10 changes: 5 additions & 5 deletions tools/serve/serve.py
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,7 @@ class HtmlWrapperHandler(WrapperHandler):

def check_exposure(self, request):
if self.global_type:
globals = ""
globals = u""
for (key, value) in self._get_metadata(request):
if key == "global":
globals = value
Expand All @@ -205,7 +205,7 @@ def _script_replacement(self, key, value):


class WorkersHandler(HtmlWrapperHandler):
global_type = b"dedicatedworker"
global_type = "dedicatedworker"
path_replace = [(".any.worker.html", ".any.js", ".any.worker.js"),
(".worker.html", ".worker.js")]
wrapper = """<!doctype html>
Expand Down Expand Up @@ -234,7 +234,7 @@ class WindowHandler(HtmlWrapperHandler):


class AnyHtmlHandler(HtmlWrapperHandler):
global_type = b"window"
global_type = "window"
path_replace = [(".any.html", ".any.js")]
wrapper = """<!doctype html>
<meta charset=utf-8>
Expand All @@ -254,7 +254,7 @@ class AnyHtmlHandler(HtmlWrapperHandler):


class SharedWorkersHandler(HtmlWrapperHandler):
global_type = b"sharedworker"
global_type = "sharedworker"
path_replace = [(".any.sharedworker.html", ".any.js", ".any.worker.js")]
wrapper = """<!doctype html>
<meta charset=utf-8>
Expand All @@ -269,7 +269,7 @@ class SharedWorkersHandler(HtmlWrapperHandler):


class ServiceWorkersHandler(HtmlWrapperHandler):
global_type = b"serviceworker"
global_type = "serviceworker"
path_replace = [(".any.serviceworker.html", ".any.js", ".any.worker.js")]
wrapper = """<!doctype html>
<meta charset=utf-8>
Expand Down

0 comments on commit f9b2d22

Please sign in to comment.