Skip to content

Commit

Permalink
Bug 1710382 [wpt PR 28926] - Rely on os.path.* returning strings (not…
Browse files Browse the repository at this point in the history
… bytes), a=testonly

Automatic update from web-platform-tests
Rely on os.path.* returning strings (not bytes) (#28926)

Part of web-platform-tests/wpt#28776.
--

wpt-commits: d25f59487c39042b3d2ee9309f8cc740e48236da
wpt-pr: 28926
  • Loading branch information
foolip authored and moz-wptsync-bot committed May 14, 2021
1 parent e3c061b commit 02f85ba
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 8 deletions.
5 changes: 1 addition & 4 deletions testing/web-platform/tests/tools/localpaths.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
import sys

here = os.path.abspath(os.path.dirname(__file__))
repo_root = os.path.abspath(os.path.join(here, os.pardir))

sys.path.insert(0, os.path.join(here))
sys.path.insert(0, os.path.join(here, "wptserve"))
Expand Down Expand Up @@ -32,7 +33,3 @@
sys.path.insert(0, os.path.join(here, "third_party", "importlib_metadata"))
sys.path.insert(0, os.path.join(here, "webdriver"))
sys.path.insert(0, os.path.join(here, "wptrunner"))

# We can't import six until we've set the path above.
from six import ensure_text
repo_root = ensure_text(os.path.abspath(os.path.join(here, os.pardir)))
7 changes: 3 additions & 4 deletions testing/web-platform/tests/tools/wpt/testfiles.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
import sys

from collections import OrderedDict
from six import ensure_text, ensure_str

try:
from ..manifest import manifest
Expand Down Expand Up @@ -38,7 +37,7 @@

DEFAULT_IGNORE_RULERS = ("resources/testharness*", "resources/testdriver*")

here = ensure_text(os.path.dirname(__file__))
here = os.path.dirname(__file__)
wpt_root = os.path.abspath(os.path.join(here, os.pardir, os.pardir))

logger = logging.getLogger()
Expand Down Expand Up @@ -136,7 +135,7 @@ def branch_point():

def compile_ignore_rule(rule):
# type: (Text) -> Pattern[Text]
rule = rule.replace(ensure_text(os.path.sep), u"/")
rule = rule.replace(os.path.sep, u"/")
parts = rule.split(u"/")
re_parts = []
for part in parts:
Expand Down Expand Up @@ -398,7 +397,7 @@ def run_changed_files(**kwargs):

for item in sorted(changed):
line = os.path.relpath(item, wpt_root) + separator
sys.stdout.write(ensure_str(line))
sys.stdout.write(line)


def run_tests_affected(**kwargs):
Expand Down

0 comments on commit 02f85ba

Please sign in to comment.