diff --git a/.gitignore b/.gitignore index 0f9cc83..0e5917e 100644 --- a/.gitignore +++ b/.gitignore @@ -13,3 +13,4 @@ __pycache__/ .arcconfig .tox/ .mypy_cache/ +build/ diff --git a/qcore/disallow_inheritance.py b/qcore/disallow_inheritance.py index 55934a0..2b942b2 100644 --- a/qcore/disallow_inheritance.py +++ b/qcore/disallow_inheritance.py @@ -28,3 +28,9 @@ def __init__(self, cl_name, bases, namespace): (cls, cl_name) raise TypeError(message) super(DisallowInheritance, self).__init__(cl_name, bases, namespace) + + # Needed bcz of a six bug: https://github.com/benjaminp/six/issues/252 + @classmethod + def __prepare__(cls, name, bases, **kwargs): + return {} + diff --git a/qcore/enum.py b/qcore/enum.py index 32e1a0f..356b002 100644 --- a/qcore/enum.py +++ b/qcore/enum.py @@ -90,6 +90,11 @@ def _make_value(self, value): member.__init__(value) return member + # Needed bcz of a six bug: https://github.com/benjaminp/six/issues/252 + @classmethod + def __prepare__(cls, name, bases, **kwargs): + return {} + class EnumBase(six.with_metaclass(EnumType)): _name_to_member = {} diff --git a/qcore/events.py b/qcore/events.py index 92d5c59..e4c10e2 100644 --- a/qcore/events.py +++ b/qcore/events.py @@ -322,6 +322,11 @@ def __repr__(self): """Gets the ``repr`` representation of this object.""" return '%s(%r)' % (self.__class__.__name__, self.__dict__) + # Needed bcz of a six bug: https://github.com/benjaminp/six/issues/252 + @classmethod + def __prepare__(cls, name, bases, **kwargs): + return {} + class EnumBasedEventHubType(type): """Metaclass for enum-based event hubs. @@ -373,6 +378,11 @@ def __init__(cls, what, bases=None, dict=None): # similar instance members delattr(cls, 'on_' + name) + # Needed bcz of a six bug: https://github.com/benjaminp/six/issues/252 + @classmethod + def __prepare__(cls, name, bases, **kwargs): + return {} + class EnumBasedEventHub(six.with_metaclass(EnumBasedEventHubType, EventHub)): __based_on__ = []