Show More
@@ -147,7 +147,7 b' class CythonMagics(Magics):' | |||
|
147 | 147 | "multiple times)." |
|
148 | 148 | ) |
|
149 | 149 | @magic_arguments.argument( |
|
150 |
'-n', '--name', |
|
|
150 | '-n', '--name', | |
|
151 | 151 | help="Specify a name for the Cython module." |
|
152 | 152 | ) |
|
153 | 153 | @magic_arguments.argument( |
@@ -209,7 +209,7 b' class CythonMagics(Magics):' | |||
|
209 | 209 | key += time.time(), |
|
210 | 210 | |
|
211 | 211 | if args.name: |
|
212 |
module_name = str(args.name |
|
|
212 | module_name = str(args.name) | |
|
213 | 213 | else: |
|
214 | 214 | module_name = "_cython_magic_" + hashlib.md5(str(key).encode('utf-8')).hexdigest() |
|
215 | 215 | module_path = os.path.join(lib_dir, module_name + self.so_ext) |
@@ -50,6 +50,14 b' def test_cython():' | |||
|
50 | 50 | nt.assert_equal(ip.user_ns['g'], 20.0) |
|
51 | 51 | |
|
52 | 52 | |
|
53 | def test_cython_name(): | |
|
54 | # The Cython module named 'mymodule' defines the function f. | |
|
55 | ip.run_cell_magic('cython', '--name=mymodule', code) | |
|
56 | # This module can now be imported in the interactive namespace. | |
|
57 | ip.ex('import mymodule; g = mymodule.f(10)') | |
|
58 | nt.assert_equal(ip.user_ns['g'], 20.0) | |
|
59 | ||
|
60 | ||
|
53 | 61 | @dec.skip_win32 |
|
54 | 62 | def test_extlibs(): |
|
55 | 63 | code = py3compat.str_to_unicode(""" |
General Comments 0
You need to be logged in to leave comments.
Login now