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)
|
||||
|
||||
|
||||
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):
|
||||
|
Loading…
Reference in New Issue
Block a user