summaryrefslogtreecommitdiff
path: root/bs4
diff options
context:
space:
mode:
authorLeonard Richardson <leonardr@segfault.org>2020-05-30 14:30:58 -0400
committerLeonard Richardson <leonardr@segfault.org>2020-05-30 14:30:58 -0400
commitb80c4201fc48617742c49411278b1853fb779a35 (patch)
tree77f96beb168040db4bc16400c6551041a40055a2 /bs4
parentcbcb02b752c52fb960f734727cc7de2ecb48ed14 (diff)
Remove explicit reference to the module name within the module, replacing it with __name__.
Diffstat (limited to 'bs4')
-rw-r--r--bs4/builder/__init__.py3
-rw-r--r--bs4/builder/_htmlparser.py2
2 files changed, 2 insertions, 3 deletions
diff --git a/bs4/builder/__init__.py b/bs4/builder/__init__.py
index e319625..03da4c6 100644
--- a/bs4/builder/__init__.py
+++ b/bs4/builder/__init__.py
@@ -476,8 +476,7 @@ class HTMLTreeBuilder(TreeBuilder):
def register_treebuilders_from(module):
"""Copy TreeBuilders from the given module into this module."""
- # I'm fairly sure this is not the best way to do this.
- this_module = sys.modules['bs4.builder']
+ this_module = sys.modules[__name__]
for name in module.__all__:
obj = getattr(module, name)
diff --git a/bs4/builder/_htmlparser.py b/bs4/builder/_htmlparser.py
index 1cb84ff..96a7b7d 100644
--- a/bs4/builder/_htmlparser.py
+++ b/bs4/builder/_htmlparser.py
@@ -181,7 +181,7 @@ class BeautifulSoupHTMLParser(HTMLParser):
# This is a redundant end tag for an empty-element tag.
# We've already called handle_endtag() for it, so just
# check it off the list.
- # print("ALREADY CLOSED", name)
+ #print("ALREADY CLOSED", name)
self.already_closed_empty_element.remove(name)
else:
self.soup.handle_endtag(name)