summaryrefslogtreecommitdiff
path: root/tests/run/numpy_parallel.pyx
diff options
context:
space:
mode:
Diffstat (limited to 'tests/run/numpy_parallel.pyx')
-rw-r--r--tests/run/numpy_parallel.pyx11
1 files changed, 5 insertions, 6 deletions
diff --git a/tests/run/numpy_parallel.pyx b/tests/run/numpy_parallel.pyx
index 0d7440f59..98a3f148f 100644
--- a/tests/run/numpy_parallel.pyx
+++ b/tests/run/numpy_parallel.pyx
@@ -1,10 +1,9 @@
-# tag: numpy_old
+# tag: numpy
# tag: openmp
cimport cython
from cython.parallel import prange
cimport numpy as np
-include "numpy_common.pxi"
@cython.boundscheck(False)
@@ -22,7 +21,7 @@ def test_parallel_numpy_arrays():
3
4
"""
- cdef Py_ssize_t i
+ cdef Py_ssize_t i, length
cdef np.ndarray[np.int_t] x
try:
@@ -33,10 +32,10 @@ def test_parallel_numpy_arrays():
return
x = numpy.zeros(10, dtype=numpy.int_)
+ length = x.shape[0]
- for i in prange(x.shape[0], nogil=True):
+ for i in prange(length, nogil=True):
x[i] = i - 5
for i in x:
- print i
-
+ print(i)