diff --git a/mcutils.py b/mcutils.py index 432cd92..94e2085 100644 --- a/mcutils.py +++ b/mcutils.py @@ -1179,7 +1179,9 @@ class dropObject(object): return "dropObject with keys %s" % self.keys() def keys(self): - k = self.__dict__.keys() + # list is needed because in py3 keys() returs a generator (and the sorting + # does noe work) + k = list(self.__dict__.keys()); k.sort() return k @@ -1191,9 +1193,6 @@ def dict2class(d,recursive=True,cleanNames=True): """Return a class that has same attributes/values and dictionaries key/value """ - #see if it is indeed a dictionary - if type(d) != types.DictType: - return None #define a dummy class c = dropObject()