1
0
Fork 0
mirror of synced 2024-11-12 19:58:57 -05:00
dotbot/dotbot/util/compat.py
Anish Athalye 69502854aa Fix compatibility
This commit fixes usage of the Singleton metaclass so that it is
compatible with both Python 2 and Python 3.
2015-01-26 10:36:36 -05:00

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', (), {})