Bug 1831512 [wpt PR 39861] - Remove use of deprecated imp module, a=testonly Automatic update from web-platform-tests Remove use of deprecated imp module This was being used to load browser modules from a path specified in a config file. That would presumably allow vendors to define an out-of-tree browser module. But in practice vendors are defining the browser modules in-tree (and it would be very difficult to define a browser out of tree without suffering frequent breakage). So since imp is deprecated just remove the entire feature. wpt-commits: 67699587804dfd8b77b77eb528f155a42e14906b wpt-pr: 39861 diff --git a/testing/web-platform/tests/tools/wptrunner/wptrunner/products.py b/testing/web-platform/tests/tools/wptrunner/wptrunner/products.py --- a/testing/web-platform/tests/tools/wptrunner/wptrunner/products.py +++ b/testing/web-platform/tests/tools/wptrunner/wptrunner/products.py @@ -1,26 +1,19 @@ # mypy: allow-untyped-defs - import importlib -import imp from .browsers import product_list def product_module(config, product): if product not in product_list: raise ValueError("Unknown product %s" % product) - path = config.get("products", {}).get(product, None) - if path: - module = imp.load_source('wptrunner.browsers.' + product, path) - else: - module = importlib.import_module("wptrunner.browsers." + product) - + module = importlib.import_module("wptrunner.browsers." + product) if not hasattr(module, "__wptrunner__"): raise ValueError("Product module does not define __wptrunner__ variable") return module class Product: def __init__(self, config, product):