##// END OF EJS Templates
ctx is ignored by Cython > 0.13.
Bradley M. Froehle -
Show More
@@ -34,7 +34,6 b' from IPython.utils import py3compat'
34
34
35 import Cython
35 import Cython
36 from Cython.Compiler.Errors import CompileError
36 from Cython.Compiler.Errors import CompileError
37 from Cython.Compiler.Main import Context, default_options
38 from Cython.Build.Dependencies import cythonize
37 from Cython.Build.Dependencies import cythonize
39
38
40
39
@@ -138,10 +137,8 b' class CythonMagics(Magics):'
138 args = magic_arguments.parse_argstring(self.cython, line)
137 args = magic_arguments.parse_argstring(self.cython, line)
139 code = cell if cell.endswith('\n') else cell+'\n'
138 code = cell if cell.endswith('\n') else cell+'\n'
140 lib_dir = os.path.join(self.shell.ipython_dir, 'cython')
139 lib_dir = os.path.join(self.shell.ipython_dir, 'cython')
141 cython_include_dirs = ['.']
142 force = args.force
140 force = args.force
143 quiet = True
141 quiet = True
144 ctx = Context(cython_include_dirs, default_options)
145 key = code, sys.version_info, sys.executable, Cython.__version__
142 key = code, sys.version_info, sys.executable, Cython.__version__
146 module_name = "_cython_magic_" + hashlib.md5(str(key).encode('utf-8')).hexdigest()
143 module_name = "_cython_magic_" + hashlib.md5(str(key).encode('utf-8')).hexdigest()
147 so_ext = [ ext for ext,_,mod_type in imp.get_suffixes() if mod_type == imp.C_EXTENSION ][0]
144 so_ext = [ ext for ext,_,mod_type in imp.get_suffixes() if mod_type == imp.C_EXTENSION ][0]
@@ -176,7 +173,7 b' class CythonMagics(Magics):'
176 build_extension = build_ext(dist)
173 build_extension = build_ext(dist)
177 build_extension.finalize_options()
174 build_extension.finalize_options()
178 try:
175 try:
179 build_extension.extensions = cythonize([extension], ctx=ctx, quiet=quiet)
176 build_extension.extensions = cythonize([extension], quiet=quiet)
180 except CompileError:
177 except CompileError:
181 return
178 return
182 build_extension.build_temp = os.path.dirname(pyx_file)
179 build_extension.build_temp = os.path.dirname(pyx_file)
General Comments 0
You need to be logged in to leave comments. Login now