Skip to content

Commit

Permalink
make cElementTree an alias for ElementTree
Browse files Browse the repository at this point in the history
  • Loading branch information
tiran committed Mar 4, 2021
1 parent 2be0182 commit 96cd347
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 22 deletions.
4 changes: 3 additions & 1 deletion CHANGES.txt
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
Changelog
=========

defusedxml 0.7.0.dev1
defusedxml 0.8.0.dev1
---------------------

- Drop support for Python 2.7, 3.4, and 3.5.


defusedxml 0.7.0
----------------
Expand Down
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -716,7 +716,9 @@ See <https://www.python.org/psf/license> for licensing details.
Injection](https://www.owasp.org/index.php/Testing_for_XML_Injection_\(OWASP-DV-008\))
# Changelog

## defusedxml 0.7.0.dev1
## defusedxml 0.8.0.dev1

- Drop support for Python 2.7, 3.4, and 3.5.

## defusedxml 0.7.0

Expand Down
34 changes: 14 additions & 20 deletions defusedxml/cElementTree.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,20 +5,20 @@
# See https://www.python.org/psf/license for licensing details.
"""Defused xml.etree.cElementTree
"""
from __future__ import absolute_import

import warnings

from .common import _generate_etree_functions

from xml.etree.cElementTree import TreeBuilder as _TreeBuilder
from xml.etree.cElementTree import parse as _parse
from xml.etree.cElementTree import tostring

# iterparse from ElementTree!
from xml.etree.ElementTree import iterparse as _iterparse

from .ElementTree import DefusedXMLParser
# This module is an alias for ElementTree just like xml.etree.cElementTree
from .ElementTree import (
XML,
XMLParse,
XMLParser,
XMLTreeBuilder,
fromstring,
iterparse,
parse,
tostring,
DefusedXMLParser,
)

__origin__ = "xml.etree.cElementTree"

Expand All @@ -29,14 +29,6 @@
stacklevel=2,
)

# XMLParse is a typo, keep it for backwards compatibility
XMLTreeBuilder = XMLParse = XMLParser = DefusedXMLParser

parse, iterparse, fromstring = _generate_etree_functions(
DefusedXMLParser, _TreeBuilder, _parse, _iterparse
)
XML = fromstring

__all__ = [
"XML",
"XMLParse",
Expand All @@ -46,4 +38,6 @@
"iterparse",
"parse",
"tostring",
# backwards compatibility
"DefusedXMLParser",
]

0 comments on commit 96cd347

Please sign in to comment.