From: Stefan Behnel Date: Fri, 24 Aug 2012 05:25:25 +0000 (+0200) Subject: fix attribute access on optimised builtin functions X-Git-Tag: 0.17b4~40 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=253a9f349ac7bfbf6735b39d5cc31a8d472be8a5;p=platform%2Fupstream%2Fpython-cython.git fix attribute access on optimised builtin functions --- diff --git a/Cython/Compiler/ExprNodes.py b/Cython/Compiler/ExprNodes.py index 48da0df..46942c1 100755 --- a/Cython/Compiler/ExprNodes.py +++ b/Cython/Compiler/ExprNodes.py @@ -4648,6 +4648,11 @@ class AttributeNode(ExprNode): if not obj_type.is_pyobject and not obj_type.is_error: if obj_type.can_coerce_to_pyobject(env): self.obj = self.obj.coerce_to_pyobject(env) + elif (obj_type.is_cfunction and self.obj.is_name + and self.obj.entry.as_variable + and self.obj.entry.as_variable.type.is_pyobject): + # might be an optimised builtin function => unpack it + self.obj = self.obj.coerce_to_pyobject(env) else: error(self.pos, "Object of type '%s' has no attribute '%s'" %