diff options
author | Gerrit Holl <g.holl@reading.ac.uk> | 2015-11-25 16:11:23 +0000 |
---|---|---|
committer | Gerrit Holl <g.holl@reading.ac.uk> | 2015-11-25 18:21:34 +0000 |
commit | 4e276acb5b5081ac9b5f54f1d0a60bf3473572b5 (patch) | |
tree | 100b7ab8d3228024f153b7f118062ff7758d2cd2 | |
parent | d94043f0fb93985fd4302eae9fcdca2d79239908 (diff) | |
download | numpy-4e276acb5b5081ac9b5f54f1d0a60bf3473572b5.tar.gz |
BUG: Fix for #6719
numpy/random/mtrand/mtrand.pyx contains a line where cython fails to
compile, complaining “Pythonic division not allowed without gil”. By
running this code segment under cdivision(True), this problem is avoided.
-rw-r--r-- | numpy/random/mtrand/mtrand.pyx | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/numpy/random/mtrand/mtrand.pyx b/numpy/random/mtrand/mtrand.pyx index f8ae8d71b..080591e5e 100644 --- a/numpy/random/mtrand/mtrand.pyx +++ b/numpy/random/mtrand/mtrand.pyx @@ -127,6 +127,7 @@ cdef extern from "initarray.h": # Initialize numpy import_array() +cimport cython import numpy as np import operator import warnings @@ -4484,7 +4485,7 @@ cdef class RandomState: mnarr = <ndarray>multin mnix = <long*>PyArray_DATA(mnarr) sz = PyArray_SIZE(mnarr) - with self.lock, nogil: + with self.lock, nogil, cython.cdivision(True): i = 0 while i < sz: Sum = 1.0 |