Skip to content

Commit dc5c0c5

Browse files
committed
Use PyLong_AsLong instead of PyInt_AsLong
1 parent 87c5086 commit dc5c0c5

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

mkl_random/mklrand.pyx

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ cdef extern from "Python.h":
3131
void PyMem_Free(void* buf)
3232

3333
double PyFloat_AsDouble(object ob)
34-
long PyInt_AsLong(object ob)
34+
long PyLong_AsLong(object ob)
3535

3636
int PyErr_Occurred()
3737
void PyErr_Clear()
@@ -4618,7 +4618,7 @@ cdef class RandomState:
46184618
cdef double fp
46194619

46204620
fp = PyFloat_AsDouble(p)
4621-
ln = PyInt_AsLong(n)
4621+
ln = PyLong_AsLong(n)
46224622
if not PyErr_Occurred():
46234623
if ln < 0:
46244624
raise ValueError("n < 0")
@@ -5090,9 +5090,9 @@ cdef class RandomState:
50905090
cdef cnp.ndarray ongood, onbad, onsample, otot
50915091
cdef long lngood, lnbad, lnsample, lntot
50925092

5093-
lngood = PyInt_AsLong(ngood)
5094-
lnbad = PyInt_AsLong(nbad)
5095-
lnsample = PyInt_AsLong(nsample)
5093+
lngood = PyLong_AsLong(ngood)
5094+
lnbad = PyLong_AsLong(nbad)
5095+
lnsample = PyLong_AsLong(nsample)
50965096
if not PyErr_Occurred():
50975097
if lngood < 0:
50985098
raise ValueError("ngood < 0")

0 commit comments

Comments
 (0)