1
0
Fork 0
mirror of synced 2024-06-01 06:51:10 -04: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

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