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

Minor fixes for bufaccess.

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