diff options
Diffstat (limited to 'Lib/xml')
-rw-r--r-- | Lib/xml/dom/domreg.py | 2 | ||||
-rw-r--r-- | Lib/xml/dom/expatbuilder.py | 4 | ||||
-rw-r--r-- | Lib/xml/dom/minidom.py | 10 |
3 files changed, 8 insertions, 8 deletions
diff --git a/Lib/xml/dom/domreg.py b/Lib/xml/dom/domreg.py index f653563..67e0104 100644 --- a/Lib/xml/dom/domreg.py +++ b/Lib/xml/dom/domreg.py @@ -62,7 +62,7 @@ def getDOMImplementation(name = None, features = ()): # User did not specify a name, try implementations in arbitrary # order, returning the one that has the required features - if isinstance(features, StringTypes): + if isinstance(features, str): features = _parse_feature_string(features) for creator in registered.values(): dom = creator() diff --git a/Lib/xml/dom/expatbuilder.py b/Lib/xml/dom/expatbuilder.py index fdb5598..a5354b9 100644 --- a/Lib/xml/dom/expatbuilder.py +++ b/Lib/xml/dom/expatbuilder.py @@ -918,7 +918,7 @@ def parse(file, namespaces=True): else: builder = ExpatBuilder() - if isinstance(file, StringTypes): + if isinstance(file, str): fp = open(file, 'rb') try: result = builder.parseFile(fp) @@ -952,7 +952,7 @@ def parseFragment(file, context, namespaces=True): else: builder = FragmentBuilder(context) - if isinstance(file, StringTypes): + if isinstance(file, str): fp = open(file, 'rb') try: result = builder.parseFile(fp) diff --git a/Lib/xml/dom/minidom.py b/Lib/xml/dom/minidom.py index 1b857a2..3087a5c 100644 --- a/Lib/xml/dom/minidom.py +++ b/Lib/xml/dom/minidom.py @@ -498,7 +498,7 @@ class NamedNodeMap(object): return L def __contains__(self, key): - if isinstance(key, StringTypes): + if isinstance(key, str): return key in self._attrs else: return key in self._attrsNS @@ -531,7 +531,7 @@ class NamedNodeMap(object): # same as set def __setitem__(self, attname, value): - if isinstance(value, StringTypes): + if isinstance(value, str): try: node = self._attrs[attname] except KeyError: @@ -1606,7 +1606,7 @@ class Document(Node, DocumentLS): return e def createTextNode(self, data): - if not isinstance(data, StringTypes): + if not isinstance(data, str): raise TypeError("node contents must be a string") t = Text() t.data = data @@ -1614,7 +1614,7 @@ class Document(Node, DocumentLS): return t def createCDATASection(self, data): - if not isinstance(data, StringTypes): + if not isinstance(data, str): raise TypeError("node contents must be a string") c = CDATASection() c.data = data @@ -1927,7 +1927,7 @@ def parseString(string, parser=None): def getDOMImplementation(features=None): if features: - if isinstance(features, StringTypes): + if isinstance(features, str): features = domreg._parse_feature_string(features) for f, v in features: if not Document.implementation.hasFeature(f, v): |