Commit 309e3a2d authored by Robert Bradshaw's avatar Robert Bradshaw

Minor fixes for bufaccess.

parent 205ea59d
...@@ -359,7 +359,7 @@ class ResolveOptions(CythonTransform): ...@@ -359,7 +359,7 @@ class ResolveOptions(CythonTransform):
for option in options: for option in options:
name, value = option name, value = option
optdict[name] = value optdict[name] = value
return self.visit_with_options(node, options) return self.visit_with_options(node, optdict)
else: else:
return self.visit_Node(node) return self.visit_Node(node)
......
cdef extern from "Python.h": cdef extern from "Python.h":
ctypedef void PyObject
ctypedef void PyTypeObject ctypedef void PyTypeObject
ctypedef struct PyObject:
Py_ssize_t ob_refcnt
PyTypeObject *ob_type
ctypedef struct FILE ctypedef struct FILE
......
...@@ -14,7 +14,7 @@ cimport python_buffer ...@@ -14,7 +14,7 @@ cimport python_buffer
cimport stdio cimport stdio
cimport cython cimport cython
cimport refcount from python_ref cimport PyObject
__test__ = {} __test__ = {}
setup_string = """ setup_string = """
...@@ -719,7 +719,7 @@ def decref(*args): ...@@ -719,7 +719,7 @@ def decref(*args):
for item in args: Py_DECREF(item) for item in args: Py_DECREF(item)
def get_refcount(x): def get_refcount(x):
return refcount.CyTest_GetRefcount(x) return (<PyObject*>x).ob_refcnt
@testcase @testcase
def printbuf_object(object[object] buf, shape): def printbuf_object(object[object] buf, shape):
...@@ -742,7 +742,7 @@ def printbuf_object(object[object] buf, shape): ...@@ -742,7 +742,7 @@ def printbuf_object(object[object] buf, shape):
""" """
cdef int i cdef int i
for i in range(shape[0]): for i in range(shape[0]):
print repr(buf[i]), refcount.CyTest_GetRefcount(buf[i]) print repr(buf[i]), (<PyObject*>buf[i]).ob_refcnt
@testcase @testcase
def assign_to_object(object[object] buf, int idx, obj): def assign_to_object(object[object] buf, int idx, obj):
......
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