Now use six.with_metaclass to create the Base type in a python 2/3 compatible way
This commit is contained in:
parent
be16f84738
commit
7cad370657
@ -517,12 +517,11 @@ class BaseMeta(type):
|
|||||||
cls.__registry__.register(cls)
|
cls.__registry__.register(cls)
|
||||||
|
|
||||||
|
|
||||||
def Base__init__(self, **kw):
|
class Base(six.with_metaclass(BaseMeta)):
|
||||||
for key, value in kw.items():
|
def __init__(self, **kw):
|
||||||
if hasattr(self, key):
|
for key, value in kw.items():
|
||||||
setattr(self, key, value)
|
if hasattr(self, key):
|
||||||
|
setattr(self, key, value)
|
||||||
Base = BaseMeta('Base', (object, ), {'__init__': Base__init__})
|
|
||||||
|
|
||||||
|
|
||||||
class File(Base):
|
class File(Base):
|
||||||
|
Loading…
Reference in New Issue
Block a user