summaryrefslogtreecommitdiff
path: root/Cython/Build/IpythonMagic.py
diff options
context:
space:
mode:
Diffstat (limited to 'Cython/Build/IpythonMagic.py')
-rw-r--r--Cython/Build/IpythonMagic.py7
1 files changed, 3 insertions, 4 deletions
diff --git a/Cython/Build/IpythonMagic.py b/Cython/Build/IpythonMagic.py
index 36031a78c..3fa43c96d 100644
--- a/Cython/Build/IpythonMagic.py
+++ b/Cython/Build/IpythonMagic.py
@@ -46,7 +46,6 @@ Parts of this code were taken from Cython.inline.
from __future__ import absolute_import, print_function
-import imp
import io
import os
import re
@@ -75,7 +74,7 @@ from IPython.utils.text import dedent
from ..Shadow import __version__ as cython_version
from ..Compiler.Errors import CompileError
-from .Inline import cython_inline
+from .Inline import cython_inline, load_dynamic
from .Dependencies import cythonize
from ..Utils import captured_fd, print_captured
@@ -357,7 +356,7 @@ class CythonMagics(Magics):
# Build seems ok, but we might still want to show any warnings that occurred
print_compiler_output(get_stdout(), get_stderr(), sys.stdout)
- module = imp.load_dynamic(module_name, module_path)
+ module = load_dynamic(module_name, module_path)
self._import_all(module)
if args.annotate:
@@ -420,7 +419,7 @@ class CythonMagics(Magics):
# import and execute module code to generate profile
so_module_path = os.path.join(lib_dir, pgo_module_name + self.so_ext)
- imp.load_dynamic(pgo_module_name, so_module_path)
+ load_dynamic(pgo_module_name, so_module_path)
def _cythonize(self, module_name, code, lib_dir, args, quiet=True):
pyx_file = os.path.join(lib_dir, module_name + '.pyx')