fixing bugs introduced by last commit
This commit is contained in:
parent
a2f6976d6d
commit
566ce8ca4e
|
@ -1193,7 +1193,7 @@ def dict2class(d,recursive=True,cleanNames=True):
|
|||
"""Return a class that has same attributes/values and
|
||||
dictionaries key/value
|
||||
"""
|
||||
|
||||
if not isinstance(d,dict): return None
|
||||
#define a dummy class
|
||||
c = dropObject()
|
||||
for elem in d.keys():
|
||||
|
@ -1204,7 +1204,7 @@ def dict2class(d,recursive=True,cleanNames=True):
|
|||
key = "value%s" % elem
|
||||
except:
|
||||
pass
|
||||
if recursive and (type(d[elem]) == types.DictType):
|
||||
if recursive and isinstance(d[elem],dict):
|
||||
c.__dict__[key] = dict2class(d[elem])
|
||||
else:
|
||||
c.__dict__[key] = d[elem]
|
||||
|
|
Loading…
Reference in New Issue