blob: 8f3f782a6259f5c80d51ced619a7af893ccde9c8 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
|
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):
|