Use __import__ instead of importlib for py26 support

This commit is contained in:
Michael Elovskikh
2016-10-03 15:05:29 +05:00
parent 7d099b65c2
commit d5ba3804bb

View File

@@ -1,5 +1,4 @@
import difflib
import importlib
import itertools
from _pytest.runner import CollectReport
@@ -494,7 +493,7 @@ class DSession:
self.ScheduleCls = EachScheduling
else:
mod_name, cls_name = dist.rsplit('.', 1)
mod = importlib.import_module(mod_name)
mod = __import__(mod_name)
self.ScheduleCls = getattr(mod, cls_name)
@property