Commit 496d4f42 authored by root's avatar root

Fix DictMix missing in py3

parent fe0f3657
......@@ -9,7 +9,6 @@ for JSON/XML/YAML output
import collections
import logging
import json
from UserDict import DictMixin
from twisted.python import log
primitives = (int, long, float, bool, str,unicode)
......@@ -20,7 +19,7 @@ def convertForSerialization(obj):
if type(obj) in primitives:
# no conversion
return obj
elif isinstance(obj, dict) or isinstance(obj,DictMixin):
elif isinstance(obj, dict):
return traverseDict(obj)
elif isClassInstance(obj):
return convertClassToDict(obj)
......@@ -66,7 +65,7 @@ def convertToJson(obj):
def generateXml(obj):
"""Generates basic XML from an object that has already been converted for serialization"""
if isinstance(obj, dict) or isinstance(obj,DictMixin):
if isinstance(obj, dict):
return getXML_dict(obj, "item")
elif isinstance(obj,collections.Iterable):
return "<list>%s</list>" % getXML(obj, "item")
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment