]> granicus.if.org Git - python/commitdiff
Two changes that are definitely problem-free and avoid calling print()
authorGuido van Rossum <guido@python.org>
Wed, 10 Oct 2007 22:48:24 +0000 (22:48 +0000)
committerGuido van Rossum <guido@python.org>
Wed, 10 Oct 2007 22:48:24 +0000 (22:48 +0000)
with a bytes instance (as this will soon print something differently).

Lib/test/test_xml_etree.py
Lib/test/test_xml_etree_c.py

index c8dd34412e9349256be0c42e8a68daf6caa23cdc..4788d3a045496a457fac1919a5f8cb3230bb935b 100644 (file)
@@ -183,9 +183,8 @@ def parseliteral():
     <html><body>text</body></html>
     >>> print(ET.tostring(element))
     <html><body>text</body></html>
-    >>> print(ET.tostring(element, "ascii"))
-    <?xml version='1.0' encoding='ascii'?>
-    <html><body>text</body></html>
+    >>> print(repr(ET.tostring(element, "ascii")))
+    b'<?xml version=\'1.0\' encoding=\'ascii\'?>\n<html><body>text</body></html>'
     >>> _, ids = ET.XMLID("<html><body>text</body></html>")
     >>> len(ids)
     0
index 22d266245165f718335abe3ae2f0fd3a62b9a601..86f18530843dd208cdeaf5684161e5db360a219d 100644 (file)
@@ -175,9 +175,8 @@ def parseliteral():
     <html><body>text</body></html>
     >>> print(ET.tostring(element))
     <html><body>text</body></html>
-    >>> print(ET.tostring(element, "ascii"))
-    <?xml version='1.0' encoding='ascii'?>
-    <html><body>text</body></html>
+    >>> print(repr(ET.tostring(element, "ascii")))
+    b'<?xml version=\'1.0\' encoding=\'ascii\'?>\n<html><body>text</body></html>'
     >>> _, ids = ET.XMLID("<html><body>text</body></html>")
     >>> len(ids)
     0