Skip to content

Commit 901e59b

Browse files
committed
import cython.long for use in Python code
1 parent 100b972 commit 901e59b

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

mkl_random/mklrand.pyx

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -196,6 +196,7 @@ cdef int r = cnp._import_array()
196196
if (r<0):
197197
raise ImportError("Failed to import NumPy")
198198

199+
from cython import long as cy_long
199200
import numpy as np
200201
import operator
201202
import warnings
@@ -5332,7 +5333,7 @@ cdef class RandomState:
53325333
cov = np.array(cov)
53335334
if size is None:
53345335
shape = []
5335-
elif isinstance(size, (int, cython.long, np.integer)):
5336+
elif isinstance(size, (int, cy_long, np.integer)):
53365337
shape = [size]
53375338
else:
53385339
shape = size
@@ -5492,7 +5493,7 @@ cdef class RandomState:
54925493

54935494
if size is None:
54945495
shape = []
5495-
elif isinstance(size, (int, cython.long, np.integer)):
5496+
elif isinstance(size, (int, cy_long, np.integer)):
54965497
shape = [size]
54975498
else:
54985499
shape = size
@@ -5896,7 +5897,7 @@ cdef class RandomState:
58965897
[3, 4, 5]])
58975898
58985899
"""
5899-
if isinstance(x, (int, cython.long, np.integer)):
5900+
if isinstance(x, (int, cy_long, np.integer)):
59005901
arr = np.arange(x)
59015902
else:
59025903
arr = np.array(x)

0 commit comments

Comments
 (0)