From a5cc757273eab5222cf730dfe227bb77e9e0815c Mon Sep 17 00:00:00 2001 From: Stefan Behnel Date: Sat, 10 Oct 2009 17:05:42 +0200 Subject: [PATCH] fix char* coercion to other C types (such as void*) --- Cython/Compiler/ExprNodes.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Cython/Compiler/ExprNodes.py b/Cython/Compiler/ExprNodes.py index b10fb2a3..bd5912dc 100644 --- a/Cython/Compiler/ExprNodes.py +++ b/Cython/Compiler/ExprNodes.py @@ -836,9 +836,11 @@ class BytesNode(ConstNode): if not self.type.is_pyobject: if dst_type in (py_object_type, Builtin.bytes_type): node = self.as_py_string_node(env) - else: + elif dst_type.is_pyobject: self.fail_assignment(dst_type) return self + else: + node = self elif dst_type.is_pyobject and dst_type is not py_object_type: self.check_for_coercion_error(dst_type, fail=True) return self -- 2.26.2