Don't delete the Meta class

This commit is contained in:
Jonathan Kim 2019-06-11 18:28:21 -07:00
parent 431e93cd68
commit 27a9a64bbb

View File

@ -37,7 +37,6 @@ class SubclassWithMeta(six.with_metaclass(SubclassWithMeta_Meta)):
_Meta _Meta
) )
) )
delattr(cls, "Meta")
options = dict(meta_options, **_meta_props) options = dict(meta_options, **_meta_props)
abstract = options.pop("abstract", False) abstract = options.pop("abstract", False)
@ -46,10 +45,10 @@ class SubclassWithMeta(six.with_metaclass(SubclassWithMeta_Meta)):
"Abstract types can only contain the abstract attribute. " "Abstract types can only contain the abstract attribute. "
"Received: abstract, {option_keys}" "Received: abstract, {option_keys}"
).format(option_keys=", ".join(options.keys())) ).format(option_keys=", ".join(options.keys()))
else:
super_class = super(cls, cls) super_class = super(cls, cls)
if hasattr(super_class, "__init_subclass_with_meta__"): if hasattr(super_class, "__init_subclass_with_meta__"):
super_class.__init_subclass_with_meta__(**options) super_class.__init_subclass_with_meta__(**options)
@classmethod @classmethod
def __init_subclass_with_meta__(cls, **meta_options): def __init_subclass_with_meta__(cls, **meta_options):