fix char* coercion to other C types (such as void*)
authorStefan Behnel <scoder@users.berlios.de>
Sat, 10 Oct 2009 15:05:42 +0000 (17:05 +0200)
committerStefan Behnel <scoder@users.berlios.de>
Sat, 10 Oct 2009 15:05:42 +0000 (17:05 +0200)
Cython/Compiler/ExprNodes.py

index b10fb2a3879bed3eea17a9d839eb27a2dcfdbb4d..bd5912dcd352a20a731e99aa72451e454d9d74ea 100644 (file)
@@ -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