Commit 9e3798fd authored by Mark Florisson's avatar Mark Florisson

py23 compat

parent ae0dbc4a
...@@ -665,16 +665,20 @@ class InterpretCompilerDirectives(CythonTransform, SkipDeclarations): ...@@ -665,16 +665,20 @@ class InterpretCompilerDirectives(CythonTransform, SkipDeclarations):
PyrexTypes.parse_basic_type(name)) PyrexTypes.parse_basic_type(name))
def is_parallel_directive(self, full_name, pos): def is_parallel_directive(self, full_name, pos):
"""
Checks to see if fullname (e.g. cython.parallel.prange) is a valid
parallel directive. If it is a star import it also updates the
parallel_directives.
"""
result = (full_name + ".").startswith("cython.parallel.") result = (full_name + ".").startswith("cython.parallel.")
if result: if result:
directive = full_name.rsplit('.', 1) directive = full_name.split('.')
if len(directive) == 2 and directive[1] == '*': if full_name == u"cython.parallel.*":
# star import
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) != 2 or elif (len(directive) != 3 or
directive[1] not in self.valid_parallel_directives): directive[-1] not in self.valid_parallel_directives):
error(pos, "No such directive: %s" % full_name) error(pos, "No such directive: %s" % full_name)
return result return result
......
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