You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

30 lines
1.0 KiB

4 years ago
  1. # defusedxml
  2. #
  3. # Copyright (c) 2013 by Christian Heimes <christian@python.org>
  4. # Licensed to PSF under a Contributor Agreement.
  5. # See http://www.python.org/psf/license for licensing details.
  6. """Defused xml.etree.cElementTree
  7. """
  8. from __future__ import absolute_import
  9. from xml.etree.cElementTree import TreeBuilder as _TreeBuilder
  10. from xml.etree.cElementTree import parse as _parse
  11. from xml.etree.cElementTree import tostring
  12. # iterparse from ElementTree!
  13. from xml.etree.ElementTree import iterparse as _iterparse
  14. from .ElementTree import DefusedXMLParser
  15. from .common import _generate_etree_functions
  16. __origin__ = "xml.etree.cElementTree"
  17. XMLTreeBuilder = XMLParse = DefusedXMLParser
  18. parse, iterparse, fromstring = _generate_etree_functions(DefusedXMLParser,
  19. _TreeBuilder, _parse,
  20. _iterparse)
  21. XML = fromstring
  22. __all__ = ['XML', 'XMLParse', 'XMLTreeBuilder', 'fromstring', 'iterparse',
  23. 'parse', 'tostring']