Commit ec3ee680 authored by Stefan Behnel's avatar Stefan Behnel

enable Python methods on C types through coercion to Python objects

parent 7245498b
...@@ -3010,14 +3010,14 @@ class AttributeNode(ExprNode): ...@@ -3010,14 +3010,14 @@ class AttributeNode(ExprNode):
if obj_type is None: if obj_type is None:
obj_type = self.obj.type obj_type = self.obj.type
self.member = self.attribute self.member = self.attribute
if obj_type.is_pyobject:
self.type = py_object_type self.type = py_object_type
self.is_py_attr = 1 self.is_py_attr = 1
else: if not obj_type.is_pyobject:
if not obj_type.is_error: self.obj = self.obj.coerce_to_pyobject(env)
error(self.pos, ## if not obj_type.is_error:
"Object of type '%s' has no attribute '%s'" % ## error(self.pos,
(obj_type, self.attribute)) ## "Object of type '%s' has no attribute '%s'" %
## (obj_type, self.attribute))
def nogil_check(self, env): def nogil_check(self, env):
if self.is_py_attr: if self.is_py_attr:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment