Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue 23607: first pass of changes for compatibility with Python3 #24435

Merged
merged 8 commits into from Oct 16, 2019

Use iteritems from six module for Python3 compatibility

  • Loading branch information
marmeladema committed Oct 15, 2019
commit 5bd0fca1405f1c7748d255dd0ba65ce7ba133c0a
@@ -22,6 +22,7 @@
import base64
import shutil
import subprocess
from six import iteritems

from mach.registrar import Registrar
from mach.decorators import (
@@ -59,7 +60,7 @@
"include_arg": "test_name"}),
])

TEST_SUITES_BY_PREFIX = {path: k for k, v in TEST_SUITES.iteritems() if "paths" in v for path in v["paths"]}
TEST_SUITES_BY_PREFIX = {path: k for k, v in iteritems(TEST_SUITES) if "paths" in v for path in v["paths"]}


def create_parser_wpt():
@@ -158,7 +159,7 @@ def test(self, params, render_mode=DEFAULT_RENDER_MODE, release=False, tidy_all=
return 1

test_start = time.time()
for suite, tests in selected_suites.iteritems():
for suite, tests in iteritems(selected_suites):
props = suites[suite]
kwargs = props.get("kwargs", {})
if tests:
@@ -174,7 +175,7 @@ def test(self, params, render_mode=DEFAULT_RENDER_MODE, release=False, tidy_all=
def suite_for_path(self, path_arg):
if os.path.exists(path.abspath(path_arg)):
abs_path = path.abspath(path_arg)
for prefix, suite in TEST_SUITES_BY_PREFIX.iteritems():
for prefix, suite in iteritems(TEST_SUITES_BY_PREFIX):
if abs_path.startswith(prefix):
return suite
return None
@@ -25,6 +25,7 @@
import voluptuous
import yaml
from licenseck import OLD_MPL, MPL, APACHE, COPYRIGHT, licenses_toml, licenses_dep_toml
from six import iteritems
topdir = os.path.abspath(os.path.dirname(sys.argv[0]))
wpt = os.path.join(topdir, "tests", "wpt")

@@ -380,7 +381,7 @@ def find_reverse_dependencies(name, content):
if name not in packages_by_name:
yield (1, "duplicates are allowed for `{}` but it is not a dependency".format(name))

for (name, packages) in packages_by_name.iteritems():
for (name, packages) in iteritems(packages_by_name):
has_duplicates = len(packages) > 1
duplicates_allowed = name in exceptions

@@ -424,7 +425,7 @@ def find_reverse_dependencies(name, content):
visited_whitelisted_packages[dependency_name][package_name] = True

# Check if all the exceptions to blocked packages actually depend on the blocked package
for dependency_name, package_names in blocked_packages.iteritems():
for dependency_name, package_names in iteritems(blocked_packages):
for package_name in package_names:
if not visited_whitelisted_packages[dependency_name].get(package_name):
fmt = "Package {} is not required to be an exception of blocked package {}."
ProTip! Use n and p to navigate between commits in a pull request.
You can’t perform that action at this time.