diff options
author | Leonard Richardson <leonardr@segfault.org> | 2020-05-30 14:30:58 -0400 |
---|---|---|
committer | Leonard Richardson <leonardr@segfault.org> | 2020-05-30 14:30:58 -0400 |
commit | b80c4201fc48617742c49411278b1853fb779a35 (patch) | |
tree | 77f96beb168040db4bc16400c6551041a40055a2 | |
parent | cbcb02b752c52fb960f734727cc7de2ecb48ed14 (diff) |
Remove explicit reference to the module name within the module, replacing it with __name__.
-rw-r--r-- | bs4/builder/__init__.py | 3 | ||||
-rw-r--r-- | bs4/builder/_htmlparser.py | 2 | ||||
-rw-r--r-- | doc/source/index.rst | 2 | ||||
-rw-r--r-- | prepare-release.sh | 4 |
4 files changed, 6 insertions, 5 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) diff --git a/doc/source/index.rst b/doc/source/index.rst index 987ffdd..91bd42b 100644 --- a/doc/source/index.rst +++ b/doc/source/index.rst @@ -18,7 +18,7 @@ with examples. I show you what the library is good for, how it works, how to use it, how to make it do what you want, and what to do when it violates your expectations. -This document covers Beautiful Soup version 4.9.0. The examples in +This document covers Beautiful Soup version 4.9.1. The examples in this documentation should work the same way in Python 2.7 and Python 3.2. diff --git a/prepare-release.sh b/prepare-release.sh index 0424ba6..cfcc59b 100644 --- a/prepare-release.sh +++ b/prepare-release.sh @@ -15,7 +15,9 @@ rm -rf build dist # Run this in a Python 2 env and a Python 3 env to make both sdist and # wheels. -python setup.py sdist bdist_wheel +python2 setup.py sdist bdist_wheel +python3 setup.py sdist bdist_wheel + # Run this in Python 3 env. |