Commit 65fe7abe authored by Batuhan Taskaya's avatar Batuhan Taskaya

py34 compat

parent 16051d6b
...@@ -4,6 +4,7 @@ from the deprecated imp module. ...@@ -4,6 +4,7 @@ from the deprecated imp module.
""" """
import os import os
import sys
import importlib.util import importlib.util
import importlib.machinery import importlib.machinery
...@@ -70,7 +71,12 @@ def _resolve(spec): ...@@ -70,7 +71,12 @@ def _resolve(spec):
else spec else spec
) )
def _module_from_spec(spec):
if sys.version_info >= (3, 5):
return importlib.util.module_from_spec(spec)
else:
return spec.loader.load_module(spec.name)
def get_module(module, paths, info): def get_module(module, paths, info):
spec = importlib.util.find_spec(module, paths) spec = importlib.util.find_spec(module, paths)
return importlib.util.module_from_spec(spec) return _module_from_spec(spec)
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment