69502854aa
This commit fixes usage of the Singleton metaclass so that it is compatible with both Python 2 and Python 3.
5 lines
210 B
Python
5 lines
210 B
Python
def with_metaclass(meta, *bases):
|
|
class metaclass(meta):
|
|
def __new__(cls, name, this_bases, d):
|
|
return meta(name, bases, d)
|
|
return type.__new__(metaclass, 'temporary_class', (), {})
|