Commit b4509b11 authored by Robert Bradshaw's avatar Robert Bradshaw Committed by GitHub

Merge pull request #1622 from jdemeyer/tp_traverse_pyobject

Pass first arg of visitproc as PyObject*
parents 7392f606 b8d0fcbc
...@@ -1495,10 +1495,9 @@ class ModuleNode(Nodes.Node, Nodes.BlockNode): ...@@ -1495,10 +1495,9 @@ class ModuleNode(Nodes.Node, Nodes.BlockNode):
for entry in py_attrs: for entry in py_attrs:
var_code = "p->%s" % entry.cname var_code = "p->%s" % entry.cname
var_as_pyobject = PyrexTypes.typecast(py_object_type, entry.type, var_code)
code.putln("if (%s) {" % var_code) code.putln("if (%s) {" % var_code)
if entry.type.is_extension_type: code.putln("e = (*v)(%s, a); if (e) return e;" % var_as_pyobject)
var_code = "((PyObject*)%s)" % var_code
code.putln("e = (*v)(%s, a); if (e) return e;" % var_code)
code.putln("}") code.putln("}")
# Traverse buffer exporting objects. # Traverse buffer exporting objects.
......
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