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:
Christophe de Vienne 2013-04-12 16:23:09 +02:00
parent e7e4910246
commit f510026ff7

View File

@ -469,8 +469,13 @@ def list_attributes(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):
__slots__ = [attr.key for attr in class_._wsme_attributes]
__slots__ = slots
DataHolder.__name__ = class_.__name__ + 'DataHolder'
return DataHolder