Skip to content

Commit 4d53198

Browse files
committed
Remove usage of deprecated imp module
It will be gone in the next version of Python. Fixes #504
1 parent 3ea9a98 commit 4d53198

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

livetest.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,8 @@
66
# Please see http://en.wikipedia.org/wiki/BSD_licenses
77

88
import copy
9-
import imp
9+
import importlib.machinery
10+
import importlib.util
1011
import os
1112
import random
1213
import re
@@ -1186,7 +1187,8 @@ def main():
11861187
namespace = probe_host(host_config)
11871188
host_config.namespace = namespace
11881189

1189-
live_test_mod = imp.new_module("livetests")
1190+
spec = importlib.machinery.ModuleSpec("livetests", None)
1191+
live_test_mod = importlib.util.module_from_spec(spec)
11901192
sys.modules["livetests"] = live_test_mod
11911193

11921194
def add_test_class(klass, name=None):

0 commit comments

Comments
 (0)