Commit 359ba798 authored by Mark Florisson's avatar Mark Florisson

Allow 'from cython cimport parallel'

parent 9d91a4ea
...@@ -696,7 +696,9 @@ class InterpretCompilerDirectives(CythonTransform, SkipDeclarations): ...@@ -696,7 +696,9 @@ class InterpretCompilerDirectives(CythonTransform, SkipDeclarations):
if result: if result:
directive = full_name.split('.') 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: for name in self.valid_parallel_directives:
self.parallel_directives[name] = u"cython.parallel.%s" % name self.parallel_directives[name] = u"cython.parallel.%s" % name
elif (len(directive) != 3 or elif (len(directive) != 3 or
......
...@@ -121,6 +121,11 @@ for i in prange(10, nogil=True): ...@@ -121,6 +121,11 @@ for i in prange(10, nogil=True):
for pyobj in prange("hello"): for pyobj in prange("hello"):
pass pass
from cython import parallel
with nogil, parallel.parallel():
for i in parallel.prange(10):
pass
_ERRORS = u""" _ERRORS = u"""
e_cython_parallel.pyx:3:8: cython.parallel.parallel is not a module 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 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