summaryrefslogtreecommitdiff
path: root/dotbot
diff options
context:
space:
mode:
Diffstat (limited to 'dotbot')
-rw-r--r--dotbot/messenger/messenger.py5
-rw-r--r--dotbot/util/compat.py5
2 files changed, 7 insertions, 3 deletions
diff --git a/dotbot/messenger/messenger.py b/dotbot/messenger/messenger.py
index 9a85a48..f87a367 100644
--- a/dotbot/messenger/messenger.py
+++ b/dotbot/messenger/messenger.py
@@ -1,11 +1,10 @@
import sys
from ..util.singleton import Singleton
+from ..util.compat import with_metaclass
from .color import Color
from .level import Level
-class Messenger(object):
- __metaclass__ = Singleton
-
+class Messenger(with_metaclass(Singleton, object)):
def __init__(self, level = Level.LOWINFO):
self.set_level(level)
diff --git a/dotbot/util/compat.py b/dotbot/util/compat.py
new file mode 100644
index 0000000..b0f8f05
--- /dev/null
+++ b/dotbot/util/compat.py
@@ -0,0 +1,5 @@
+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', (), {})