Commit b8c4fc58 authored by mattip's avatar mattip

fixes from review

parent 21f1a73c
...@@ -975,14 +975,12 @@ cdef extern from "numpy/ufuncobject.h": ...@@ -975,14 +975,12 @@ cdef extern from "numpy/ufuncobject.h":
int _import_umath() except -1 int _import_umath() except -1
cdef inline void set_array_base(ndarray arr, object base): cdef inline void set_array_base(ndarray arr, object base):
Py_INCREF(base) Py_INCREF(base) # important to do this before decref below!
PyArray_SetBaseObject(arr, base) PyArray_SetBaseObject(arr, base)
cdef inline object get_array_base(ndarray arr): cdef inline object get_array_base(ndarray arr):
base = PyArray_BASE(arr) base = PyArray_BASE(arr)
# Do we need to convert NULL -> None? return <object>base
# Do we need to incref base or is that done by cython?
return base
# Versions of the import_* functions which are more suitable for # Versions of the import_* functions which are more suitable for
# Cython code. # Cython code.
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment