Commit 28a78cb2 authored by Stefan Behnel's avatar Stefan Behnel

clean up recent incorrect change in Symtab code that validated the property...

clean up recent incorrect change in Symtab code that validated the property generation for extension type attributes
parent 827daa8f
...@@ -1892,10 +1892,9 @@ class CClassScope(ClassScope): ...@@ -1892,10 +1892,9 @@ class CClassScope(ClassScope):
entry.needs_property = True entry.needs_property = True
if name == "__weakref__": if name == "__weakref__":
error(pos, "Special attribute __weakref__ cannot be exposed to Python") error(pos, "Special attribute __weakref__ cannot be exposed to Python")
if not type.is_pyobject: if not (type.is_pyobject or type.can_coerce_to_pyobject(self)):
if (not type.can_coerce_to_pyobject(self) or # we're not testing for coercion *from* Python here - that would fail later
(visibility == 'public' and not type.can_coerce_to_pyobject(self))): error(pos, "C attribute of type '%s' cannot be accessed from Python" % type)
error(pos, "C attribute of type '%s' cannot be accessed from Python" % type)
else: else:
entry.needs_property = False entry.needs_property = False
return entry return entry
......
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