summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLeonard Richardson <leonardr@segfault.org>2023-01-25 14:52:31 -0500
committerLeonard Richardson <leonardr@segfault.org>2023-01-25 14:52:31 -0500
commit1f51372069b3cc204ffc43b6ef59a82f4bd32f07 (patch)
tree1a962d0d621730e6764eab329136d758a996e7a6
parent9f29d5b62539d8020b3e99e084c52a45996b7403 (diff)
The HTMLFormatter and XMLFormatter constructors no longer return a
value. [bug=1992693]
-rw-r--r--CHANGELOG3
-rw-r--r--bs4/formatter.py4
-rw-r--r--bs4/tests/test_tree.py2
3 files changed, 6 insertions, 3 deletions
diff --git a/CHANGELOG b/CHANGELOG
index 3fe20e6..a2134ad 100644
--- a/CHANGELOG
+++ b/CHANGELOG
@@ -12,6 +12,9 @@ Bazaar repository, the final revision to support Python 2 was 605.
* Fixed another crash when overriding multi_valued_attributes and using the
html5lib parser. [bug=1948488]
+* The HTMLFormatter and XMLFormatter constructors no longer return a
+ value. [bug=1992693]
+
* Passing a Tag's .contents into PageElement.extend() now works the
same way as passing the Tag itself.
diff --git a/bs4/formatter.py b/bs4/formatter.py
index 65e57b5..83cc1c5 100644
--- a/bs4/formatter.py
+++ b/bs4/formatter.py
@@ -149,14 +149,14 @@ class HTMLFormatter(Formatter):
"""A generic Formatter for HTML."""
REGISTRY = {}
def __init__(self, *args, **kwargs):
- return super(HTMLFormatter, self).__init__(self.HTML, *args, **kwargs)
+ super(HTMLFormatter, self).__init__(self.HTML, *args, **kwargs)
class XMLFormatter(Formatter):
"""A generic Formatter for XML."""
REGISTRY = {}
def __init__(self, *args, **kwargs):
- return super(XMLFormatter, self).__init__(self.XML, *args, **kwargs)
+ super(XMLFormatter, self).__init__(self.XML, *args, **kwargs)
# Set up aliases for the default formatters.
diff --git a/bs4/tests/test_tree.py b/bs4/tests/test_tree.py
index f40e764..e456966 100644
--- a/bs4/tests/test_tree.py
+++ b/bs4/tests/test_tree.py
@@ -913,7 +913,7 @@ class TestTreeModification(SoupTest):
@pytest.mark.parametrize(
"get_tags", [lambda tag: tag, lambda tag: tag.contents]
)
- def test_extend_with_another_tags_contents(self, tags):
+ def test_extend_with_another_tags_contents(self, get_tags):
data = '<body><div id="d1"><a>1</a><a>2</a><a>3</a><a>4</a></div><div id="d2"></div></body>'
soup = self.soup(data)
d1 = soup.find('div', id='d1')