Commit 2d3e49a1 authored by Mark Florisson's avatar Mark Florisson

Fix Python 3 compatibility

parent a578b2a5
......@@ -5993,6 +5993,9 @@ class ParallelRangeNode(ParallelStatNode):
self.is_nogil = self.kwargs.pop('nogil', False)
self.schedule = self.kwargs.pop('schedule', None)
if hasattr(self.schedule, 'decode'):
self.schedule = self.schedule.decode('ascii')
if self.schedule not in (None, 'static', 'dynamic', 'guided',
'runtime'):
error(self.pos, "Invalid schedule argument to prange: %r" %
......
......@@ -10,6 +10,12 @@ from libc.stdio cimport puts
import sys
try:
from builtins import next # Py3k
except ImportError:
def next(it):
return it.next()
#@cython.test_assert_path_exists(
# "//ParallelWithBlockNode//ParallelRangeNode[@schedule = 'dynamic']",
# "//GILStatNode[@state = 'nogil]//ParallelRangeNode")
......@@ -163,7 +169,7 @@ def test_closure_parallel_privates():
yield x
g = test_generator()
print g.next(), x, g.next(), x
print next(g), x, next(g), x
def test_pure_mode():
"""
......
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