mirror of
https://github.com/python/cpython.git
synced 2025-07-29 06:05:00 +00:00
#4490 Fix sample code run by "python -m xml.sax.xmlreader"
This commit is contained in:
parent
d9920c255d
commit
e71bd81a89
1 changed files with 3 additions and 3 deletions
|
@ -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")
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue