Commit 9355dc5e authored by Matti Picus's avatar Matti Picus Committed by GitHub

Remove deprecated import of imp module (#3350)

parent 105cf92d
......@@ -32,6 +32,14 @@ if sys.version_info[0] < 3:
else:
to_unicode = lambda x: x
if sys.version_info[:2] < (3, 3):
import imp
def load_dynamic(name, module_path):
return imp.load_dynamic(name, module_path)
else:
from importlib.machinery import ExtensionFileLoader
def load_dynamic(name, module_path):
return ExtensionFileLoader(name, module_path).load_module()
class UnboundSymbols(EnvTransform, SkipDeclarations):
def __init__(self):
......@@ -246,7 +254,7 @@ def __invoke(%(params)s):
build_extension.build_lib = lib_dir
build_extension.run()
module = imp.load_dynamic(module_name, module_path)
module = load_dynamic(module_name, module_path)
_cython_inline_cache[orig_code, arg_sigs] = module.__invoke
arg_list = [kwds[arg] for arg in arg_names]
......
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