Commit d81b2e39 authored by Stefan Behnel's avatar Stefan Behnel

seems that allowing C functions without argument names to coerce to Python...

seems that allowing C functions without argument names to coerce to Python functions goes wrong (note: Python coercion is attempted more often than needed!)
parent 0ef0a005
...@@ -2659,6 +2659,9 @@ class CFuncType(CType): ...@@ -2659,6 +2659,9 @@ class CFuncType(CType):
for arg in self.args: for arg in self.args:
if not arg.type.is_pyobject and not arg.type.create_from_py_utility_code(env): if not arg.type.is_pyobject and not arg.type.create_from_py_utility_code(env):
return False return False
# FIXME: it seems we're trying to coerce in more cases than we should - restrict to user triggered cases
if not arg.name:
return False
if not (self.return_type.is_pyobject or self.return_type.is_void or if not (self.return_type.is_pyobject or self.return_type.is_void or
self.return_type.create_to_py_utility_code(env)): self.return_type.create_to_py_utility_code(env)):
return False return False
......
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