From ceee9911ca1cc8b1e67efeea6ed74564f4820c3f Mon Sep 17 00:00:00 2001 From: Leonard Richardson Date: Wed, 17 Jan 2024 10:56:15 -0500 Subject: Added the correct stacklevel to instances of the XMLParsedAsHTMLWarning. [bug=2034451] --- bs4/builder/_lxml.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'bs4/builder/_lxml.py') diff --git a/bs4/builder/_lxml.py b/bs4/builder/_lxml.py index 971c81e..4f7cf74 100644 --- a/bs4/builder/_lxml.py +++ b/bs4/builder/_lxml.py @@ -179,7 +179,9 @@ class LXMLTreeBuilderForXML(TreeBuilder): self.processing_instruction_class = ProcessingInstruction # We're in HTML mode, so if we're given XML, that's worth # noting. - DetectsXMLParsedAsHTML.warn_if_markup_looks_like_xml(markup) + DetectsXMLParsedAsHTML.warn_if_markup_looks_like_xml( + markup, stacklevel=3 + ) else: self.processing_instruction_class = XMLProcessingInstruction -- cgit v1.2.3