Fix a problem when a complex type has a 'attr' attribute, due to the DataHolder
__slots__ list construction, which leads to a DataHolder having a wsattr.
This commit is contained in:
parent
e7e4910246
commit
f510026ff7
@ -469,8 +469,13 @@ def list_attributes(class_):
|
|||||||
|
|
||||||
|
|
||||||
def make_dataholder(class_):
|
def make_dataholder(class_):
|
||||||
|
# the slots are computed outside the class scope to avoid
|
||||||
|
# 'attr' to pullute the class namespace, which leads to weird
|
||||||
|
# things if one of the slots is named 'attr'.
|
||||||
|
slots = [attr.key for attr in class_._wsme_attributes]
|
||||||
|
|
||||||
class DataHolder(object):
|
class DataHolder(object):
|
||||||
__slots__ = [attr.key for attr in class_._wsme_attributes]
|
__slots__ = slots
|
||||||
|
|
||||||
DataHolder.__name__ = class_.__name__ + 'DataHolder'
|
DataHolder.__name__ = class_.__name__ + 'DataHolder'
|
||||||
return DataHolder
|
return DataHolder
|
||||||
|
Loading…
x
Reference in New Issue
Block a user