zdtm: drop python 2 compatibility

This patch removes the code for Python 2 compatibility introduced
with commit e65c7b5 (zdtm: Replace imp module with importlib).

Signed-off-by: Radostin Stoyanov <rstoyanov@fedoraproject.org>
This commit is contained in:
Radostin Stoyanov 2023-06-22 04:00:39 +01:00 committed by Andrei Vagin
parent 460c4d2697
commit 75d9d6822a

View file

@ -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