Skip to content

Commit

Permalink
Bug 1639004 - Make mach wpt-metadata-summary run in Python 3, r=karlcow
Browse files Browse the repository at this point in the history
  • Loading branch information
jgraham committed Oct 26, 2020
1 parent 10c81eb commit adcdde0
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 8 deletions.
1 change: 0 additions & 1 deletion mach
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@ py2commands="
wpt
wpt-manifest-update
wpt-metadata-merge
wpt-metadata-summary
wpt-serve
wpt-test-paths
wpt-unittest
Expand Down
14 changes: 7 additions & 7 deletions testing/web-platform/metasummary.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import logging
import os
import re
import urlparse
from urllib import parse as urlparse
from collections import defaultdict

import manifestupdate
Expand Down Expand Up @@ -133,7 +133,7 @@ def get_manifest(metadata_root, test_path, url_base):
"""
manifest_path = expected.expected_path(metadata_root, test_path)
try:
with open(manifest_path) as f:
with open(manifest_path, "rb") as f:
return compile(f,
data_cls_getter=data_cls_getter,
test_path=test_path,
Expand All @@ -151,7 +151,7 @@ def get_dir_manifest(path):
values should be computed.
"""
try:
with open(path) as f:
with open(path, "rb") as f:
return compile(f, data_cls_getter=lambda x, y: DirectoryManifest)
except IOError:
return None
Expand Down Expand Up @@ -216,7 +216,7 @@ def get_dir_paths(test_root, test_path):


def iter_tests(manifests):
for manifest in manifests.iterkeys():
for manifest in manifests.keys():
for test_type, test_path, tests in manifest:
url_base = manifests[manifest]["url_base"]
metadata_base = manifests[manifest]["metadata_path"]
Expand Down Expand Up @@ -326,10 +326,10 @@ def update_wpt_meta(logger, meta_root, data):
raise ValueError("%s is not a directory" % (meta_root,))

with WptMetaCollection(meta_root) as wpt_meta:
for dir_path, dir_data in sorted(data.iteritems()):
for test, test_data in dir_data.get("_tests", {}).iteritems():
for dir_path, dir_data in sorted(data.items()):
for test, test_data in dir_data.get("_tests", {}).items():
add_test_data(logger, wpt_meta, dir_path, test, None, test_data)
for subtest, subtest_data in test_data.get("_subtests", {}).iteritems():
for subtest, subtest_data in test_data.get("_subtests", {}).items():
add_test_data(logger, wpt_meta, dir_path, test, subtest, subtest_data)


Expand Down

0 comments on commit adcdde0

Please sign in to comment.