Closed
Description
Disabling the cache_builtins
option in setup.py:
Options.cache_builtins = False
causes code that uses MemoryView
to fail to compile:
Error compiling Cython file:
------------------------------------------------------------
...
if not is_slice:
if start < 0:
start += shape
if not 0 <= start < shape:
_err_dim(IndexError, "Index out of bounds (axis %d)", dim)
^
------------------------------------------------------------
View.MemoryView:832:21: Accessing Python global or builtin not allowed without gil
(There are several such errors building the file, all stemming from doing a lookup on the exception type without the GIL held.)
To fix this, the GIL should be locked before calling _err_dim.