projects
/
cython.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
fdafa53
)
emulate original error for attributes on unconvertible types
author
Stefan Behnel
<scoder@users.berlios.de>
Thu, 3 Dec 2009 12:48:49 +0000
(13:48 +0100)
committer
Stefan Behnel
<scoder@users.berlios.de>
Thu, 3 Dec 2009 12:48:49 +0000
(13:48 +0100)
Cython/Compiler/ExprNodes.py
patch
|
blob
|
history
diff --git
a/Cython/Compiler/ExprNodes.py
b/Cython/Compiler/ExprNodes.py
index 5b37aee020a555c923183fccf629dc0108040715..db34be5c946669a701a06b20ce7284b98986c3c9 100644
(file)
--- a/
Cython/Compiler/ExprNodes.py
+++ b/
Cython/Compiler/ExprNodes.py
@@
-3012,8
+3012,13
@@
class AttributeNode(ExprNode):
self.member = self.attribute
self.type = py_object_type
self.is_py_attr = 1
- if not obj_type.is_pyobject:
- self.obj = self.obj.coerce_to_pyobject(env)
+ if not obj_type.is_pyobject and not obj_type.is_error:
+ if obj_type.create_to_py_utility_code(env):
+ self.obj = self.obj.coerce_to_pyobject(env)
+ else:
+ error(self.pos,
+ "Object of type '%s' has no attribute '%s'" %
+ (obj_type, self.attribute))
def nogil_check(self, env):
if self.is_py_attr: