summaryrefslogtreecommitdiffstats
path: root/Lib/xml/sax/saxutils.py
diff options
context:
space:
mode:
Diffstat (limited to 'Lib/xml/sax/saxutils.py')
-rw-r--r--Lib/xml/sax/saxutils.py12
1 files changed, 2 insertions, 10 deletions
diff --git a/Lib/xml/sax/saxutils.py b/Lib/xml/sax/saxutils.py
index ff9f596..a4bcb08 100644
--- a/Lib/xml/sax/saxutils.py
+++ b/Lib/xml/sax/saxutils.py
@@ -3,18 +3,10 @@ A library of useful helper classes to the SAX classes, for the
convenience of application and driver writers.
"""
-import os, urlparse, urllib, types
+import os, urlparse, urllib
from . import handler
from . import xmlreader
-try:
- _StringTypes = [types.StringType, types.UnicodeType]
-except AttributeError:
- try:
- _StringTypes = [types.StringType]
- except AttributeError:
- _StringTypes = [str]
-
# See whether the xmlcharrefreplace error handler is
# supported
try:
@@ -280,7 +272,7 @@ def prepare_input_source(source, base = ""):
"""This function takes an InputSource and an optional base URL and
returns a fully resolved InputSource object ready for reading."""
- if type(source) in _StringTypes:
+ if isinstance(source, basestring):
source = xmlreader.InputSource(source)
elif hasattr(source, "read"):
f = source