Now use six.with_metaclass to create the Base type in a python 2/3 compatible way

This commit is contained in:
Christophe de Vienne 2012-10-06 21:18:05 +02:00
parent be16f84738
commit 7cad370657

View File

@ -517,12 +517,11 @@ class BaseMeta(type):
cls.__registry__.register(cls)
def Base__init__(self, **kw):
for key, value in kw.items():
if hasattr(self, key):
setattr(self, key, value)
Base = BaseMeta('Base', (object, ), {'__init__': Base__init__})
class Base(six.with_metaclass(BaseMeta)):
def __init__(self, **kw):
for key, value in kw.items():
if hasattr(self, key):
setattr(self, key, value)
class File(Base):