diff --git a/test/zdtm.py b/test/zdtm.py index b56f06ef1..c6e852dc1 100755 --- a/test/zdtm.py +++ b/test/zdtm.py @@ -635,14 +635,10 @@ class zdtm_test: def load_module_from_file(name, path): - if sys.version_info[0] == 3 and sys.version_info[1] >= 5: - import importlib.util - spec = importlib.util.spec_from_file_location(name, path) - mod = importlib.util.module_from_spec(spec) - spec.loader.exec_module(mod) - else: - import imp - mod = imp.load_source(name, path) + import importlib.util + spec = importlib.util.spec_from_file_location(name, path) + mod = importlib.util.module_from_spec(spec) + spec.loader.exec_module(mod) return mod