Commit a7c689c1 authored by Robert Bradshaw's avatar Robert Bradshaw

Another cpp-class-as-cdef-class-member fix, fix test with side effect.

parent b757adc9
...@@ -1099,8 +1099,9 @@ class ModuleNode(Nodes.Node, Nodes.BlockNode): ...@@ -1099,8 +1099,9 @@ class ModuleNode(Nodes.Node, Nodes.BlockNode):
code.putln("if (p->__weakref__) PyObject_ClearWeakRefs(o);") code.putln("if (p->__weakref__) PyObject_ClearWeakRefs(o);")
for entry in cpp_class_attrs: for entry in cpp_class_attrs:
class_name = entry.type.cname.split("::")[-1] destructor_name = entry.type.cname.split("::")[-1]
code.putln("p->%s.~%s();" % (entry.cname, class_name)) code.putln("p->%s.%s::~%s();" %
(entry.cname, entry.type.declaration_code(""), destructor_name))
for entry in py_attrs: for entry in py_attrs:
code.put_xdecref_clear("p->%s" % entry.cname, entry.type, nanny=False, code.put_xdecref_clear("p->%s" % entry.cname, entry.type, nanny=False,
......
...@@ -1346,7 +1346,7 @@ def flush_and_terminate(status): ...@@ -1346,7 +1346,7 @@ def flush_and_terminate(status):
def main(): def main():
global DISTDIR global DISTDIR, WITH_CYTHON
DISTDIR = os.path.join(os.getcwd(), os.path.dirname(sys.argv[0])) DISTDIR = os.path.join(os.getcwd(), os.path.dirname(sys.argv[0]))
from optparse import OptionParser from optparse import OptionParser
......
...@@ -10,3 +10,9 @@ def stack_vector_in_generator(vector[int] vint): ...@@ -10,3 +10,9 @@ def stack_vector_in_generator(vector[int] vint):
""" """
for i in vint: for i in vint:
yield i yield i
def vector_arg_in_function(py_v):
"""
>>> print "Unneeded function with side effect."
"""
cdef vector[int] v = py_v
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