catacomb/pwsafe.py: Hack around the change in metaclass syntax.
[catacomb-python] / catacomb / pwsafe.py
index 7951e0a..5e296e3 100644 (file)
@@ -48,6 +48,10 @@ _NUL = _bin('\0')
 _CIPHER = _bin('cipher:')
 _MAC = _bin('mac:')
 
+def _with_metaclass(meta, *supers):
+  return meta("#<anonymous base %s>" % meta.__name__,
+              supers or (object,), dict())
+
 def _excval(): return SYS.exc_info()[1]
 
 _M600 = int("600", 8)
@@ -235,7 +239,7 @@ class StorageBackendClass (type):
     except AttributeError: pass
     else: StorageBackend.register_concrete_subclass(me)
 
-class StorageBackend (object):
+class StorageBackend (_with_metaclass(StorageBackendClass)):
   """
   I provide basic protocol for password storage backends.
 
@@ -303,7 +307,6 @@ class StorageBackend (object):
                         priority order when opening an existing database.
   """
 
-  __metaclass__ = StorageBackendClass
   PRIO = 10
 
   ## The registry of subclasses.