From 2294160a6a424858d89331b51027abd4ba757c7b Mon Sep 17 00:00:00 2001 From: Chris Mayo Date: Wed, 30 Nov 2022 19:21:06 +0000 Subject: [PATCH] Fix minimum version of Beautiful Soup increased to 4.11.0 Since: 6d9061b0 ("Ignore bs4 markup and XML parser warnings", 2022-09-02) --- linkcheck/htmlutil/htmlsoup.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/linkcheck/htmlutil/htmlsoup.py b/linkcheck/htmlutil/htmlsoup.py index d8af6a08..34886a32 100644 --- a/linkcheck/htmlutil/htmlsoup.py +++ b/linkcheck/htmlutil/htmlsoup.py @@ -28,11 +28,13 @@ warnings.filterwarnings( import bs4 -warnings.simplefilter( +# bs4 4.9.1 introduced MarkupResemblesLocatorWarning +hasattr(bs4, "MarkupResemblesLocatorWarning") and warnings.simplefilter( 'ignore', bs4.MarkupResemblesLocatorWarning ) -warnings.simplefilter( +# bs4 4.11.0 introduced builder.XMLParsedAsHTMLWarning +hasattr(bs4.builder, "XMLParsedAsHTMLWarning") and warnings.simplefilter( 'ignore', bs4.builder.XMLParsedAsHTMLWarning )