From 94d3be2d43eddc016ebeb813299bcca0484ca2be Mon Sep 17 00:00:00 2001 From: Christian Heimes Date: Sun, 14 Apr 2019 11:37:35 +0200 Subject: Deprecate lxml Signed-off-by: Christian Heimes --- defusedxml/lxml.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/defusedxml/lxml.py b/defusedxml/lxml.py index 3468824..f16256f 100644 --- a/defusedxml/lxml.py +++ b/defusedxml/lxml.py @@ -10,6 +10,8 @@ The code has NO protection against decompression bombs. from __future__ import print_function, absolute_import import threading +import warnings + from lxml import etree as _etree from .common import DTDForbidden, EntitiesForbidden, NotSupportedError @@ -21,6 +23,13 @@ __origin__ = "lxml.etree" tostring = _etree.tostring +warnings.warn( + "defusedxml.lxml is no longer supported and will be removed in a " + "future release.", + category=DeprecationWarning +) + + class RestrictedElement(_etree.ElementBase): """A restricted Element class that filters out instances of some classes """ -- cgit v1.2.1