From: Stefan Behnel Date: Sat, 10 Oct 2009 15:05:42 +0000 (+0200) Subject: fix char* coercion to other C types (such as void*) X-Git-Tag: 0.13.beta0~2^2~121^2~82 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=a5cc757273eab5222cf730dfe227bb77e9e0815c;p=cython.git fix char* coercion to other C types (such as void*) --- 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