]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
#4490 Fix sample code run by "python -m xml.sax.xmlreader"
authorAmaury Forgeot d'Arc <amauryfa@gmail.com>
Mon, 22 Jun 2009 19:33:48 +0000 (19:33 +0000)
committerAmaury Forgeot d'Arc <amauryfa@gmail.com>
Mon, 22 Jun 2009 19:33:48 +0000 (19:33 +0000)
Lib/xml/sax/expatreader.py

index e6d1902df68f566d5f8a484ce483abf54bb0723e..92a79c1c74d1d220762b0be1b4afc93da3ec51d7 100644 (file)
@@ -407,8 +407,8 @@ def create_parser(*args, **kwargs):
 # ---
 
 if __name__ == "__main__":
-    import xml.sax
+    import xml.sax.saxutils
     p = create_parser()
-    p.setContentHandler(xml.sax.XMLGenerator())
+    p.setContentHandler(xml.sax.saxutils.XMLGenerator())
     p.setErrorHandler(xml.sax.ErrorHandler())
-    p.parse("../../../hamlet.xml")
+    p.parse("http://www.ibiblio.org/xml/examples/shakespeare/hamlet.xml")