From d3e89c97246b8820f2572ee7d5dd0fd346e72689 Mon Sep 17 00:00:00 2001 From: Stefan Behnel Date: Tue, 20 Oct 2009 20:08:31 +0200 Subject: [PATCH] don't allow pointer assignments to Python variables (except for char*) --- Cython/Compiler/PyrexTypes.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Cython/Compiler/PyrexTypes.py b/Cython/Compiler/PyrexTypes.py index 47182132..74fa88fb 100644 --- a/Cython/Compiler/PyrexTypes.py +++ b/Cython/Compiler/PyrexTypes.py @@ -336,7 +336,8 @@ class PyObjectType(PyrexType): return "" 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): -- 2.26.2