Commit c4f4009e authored by Mark Florisson's avatar Mark Florisson

Allow 'from cython cimport parallel'

--HG--
extra : transplant_source : %C3%15%11%60%5D%00%F0%D2%FC%28%C8KdS%C9%3D%EC%9Bn%00
parent 3bdab41f
......@@ -678,7 +678,9 @@ class InterpretCompilerDirectives(CythonTransform, SkipDeclarations):
if result:
directive = full_name.split('.')
if full_name == u"cython.parallel.*":
if full_name == u"cython.parallel":
self.parallel_directives[u"parallel"] = u"cython.parallel"
elif full_name == u"cython.parallel.*":
for name in self.valid_parallel_directives:
self.parallel_directives[name] = u"cython.parallel.%s" % name
elif (len(directive) != 3 or
......
......@@ -121,6 +121,11 @@ for i in prange(10, nogil=True):
for pyobj in prange("hello"):
pass
from cython import parallel
with nogil, parallel.parallel():
for i in parallel.prange(10):
pass
_ERRORS = u"""
e_cython_parallel.pyx:3:8: cython.parallel.parallel is not a module
e_cython_parallel.pyx:4:0: No such directive: cython.parallel.something
......
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