diff options
Diffstat (limited to 'Lib/test/test_xml_etree.py')
-rw-r--r-- | Lib/test/test_xml_etree.py | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/Lib/test/test_xml_etree.py b/Lib/test/test_xml_etree.py index 1c5edd0..c8dd344 100644 --- a/Lib/test/test_xml_etree.py +++ b/Lib/test/test_xml_etree.py @@ -39,14 +39,11 @@ def check_method(method): if not hasattr(method, '__call__'): print(method, "not callable") -def serialize(ET, elem, encoding=None): - import StringIO - file = StringIO.StringIO() +def serialize(ET, elem): + import io tree = ET.ElementTree(elem) - if encoding: - tree.write(file, encoding) - else: - tree.write(file) + file = io.StringIO() + tree.write(file) return file.getvalue() def summarize(elem): |