projects
/
platform
/
upstream
/
python-cython.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
6c30dd8
)
fix attribute access on optimised builtin functions
author
Stefan Behnel
<stefan_ml@behnel.de>
Fri, 24 Aug 2012 05:25:25 +0000
(07:25 +0200)
committer
Stefan Behnel
<stefan_ml@behnel.de>
Fri, 24 Aug 2012 05:25:25 +0000
(07:25 +0200)
Cython/Compiler/ExprNodes.py
patch
|
blob
|
history
diff --git
a/Cython/Compiler/ExprNodes.py
b/Cython/Compiler/ExprNodes.py
index
48da0df
..
46942c1
100755
(executable)
--- 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'" %