don't allow pointer assignments to Python variables (except for char*)
authorStefan Behnel <scoder@users.berlios.de>
Tue, 20 Oct 2009 18:08:31 +0000 (20:08 +0200)
committerStefan Behnel <scoder@users.berlios.de>
Tue, 20 Oct 2009 18:08:31 +0000 (20:08 +0200)
Cython/Compiler/PyrexTypes.py

index 471821327c7e6b3ea3a8669d29da0cb6cdda6a71..74fa88fb2aad4830d64c02885860a00e6e84c4bb 100644 (file)
@@ -336,7 +336,8 @@ class PyObjectType(PyrexType):
         return "<PyObjectType>"
     
     def assignable_from(self, src_type):
-        return 1 # Conversion will be attempted
+        # except for pointers, conversion will be attempted
+        return not src_type.is_ptr or src_type.is_string
         
     def declaration_code(self, entity_code, 
             for_display = 0, dll_linkage = None, pyrex = 0):