do not depend on types.StringTypes anymore
[sfa.git] / sfa / util / xml.py
index f46443a..9c4a80f 100755 (executable)
@@ -1,10 +1,11 @@
 #!/usr/bin/python 
 #!/usr/bin/python 
-from types import StringTypes
 from lxml import etree
 from StringIO import StringIO
 from sfa.util.faults import InvalidXML
 from sfa.rspecs.elements.element import Element
 
 from lxml import etree
 from StringIO import StringIO
 from sfa.util.faults import InvalidXML
 from sfa.rspecs.elements.element import Element
 
+from sfa.util.py23 import StringType
+
 # helper functions to help build xpaths
 class XpathFilter:
     @staticmethod
 # helper functions to help build xpaths
 class XpathFilter:
     @staticmethod
@@ -239,7 +240,7 @@ class XML:
         d=d.copy()
         # looks like iteritems won't stand side-effects
         for k in d.keys():
         d=d.copy()
         # looks like iteritems won't stand side-effects
         for k in d.keys():
-            if not isinstance(d[k],StringTypes):
+            if not isinstance(d[k], StringType):
                 del d[k]
 
         element.attrib.update(d)
                 del d[k]
 
         element.attrib.update(d)