diff --git a/CHANGES.md b/CHANGES.md index dfbacbd..6932e40 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -6,7 +6,7 @@ * Change remind user when testing Notifications config / Discord to update URL * Fix incorrect text for some drop down list items in the apiBuilder view that affected some browsers * Update attr 20.1.0.dev0 (4bd6827) to 20.2.0 (4f74fba) -* Update Beautiful Soup 4.8.2 (r559) to 4.9.2 (r590) +* Update Beautiful Soup 4.8.2 (r559) to 4.9.3 (r593) * Update dateutil 2.8.1 (43b7838) to 2.8.1 (c496b4f) * Change add diskcache_py3 5.0.1 (9670fbb) * Change add diskcache_py2 4.1.0 (b0451e0) @@ -25,6 +25,7 @@ [develop changelog] +* Update Beautiful Soup 4.9.1 (r585) to 4.9.2 (r590) * Update Beautiful Soup 4.8.2 (r559) to 4.9.1 (r585) * Fix update Soupsieve (05086ef) broke MC and TVC browse cards diff --git a/lib/bs4_py2/__init__.py b/lib/bs4_py2/__init__.py index fd33ad1..8f78809 100644 --- a/lib/bs4_py2/__init__.py +++ b/lib/bs4_py2/__init__.py @@ -15,7 +15,7 @@ documentation: http://www.crummy.com/software/BeautifulSoup/bs4/doc/ """ __author__ = "Leonard Richardson (leonardr@segfault.org)" -__version__ = "4.9.2" +__version__ = "4.9.3" __copyright__ = "Copyright (c) 2004-2020 Leonard Richardson" # Use of this source code is governed by the MIT license. __license__ = "MIT" diff --git a/lib/bs4_py2/element.py b/lib/bs4_py2/element.py index 9fae609..aa1a80d 100644 --- a/lib/bs4_py2/element.py +++ b/lib/bs4_py2/element.py @@ -1995,6 +1995,14 @@ class SoupStrainer(object): if isinstance(markup_name, Tag): markup = markup_name markup_attrs = markup + + if isinstance(self.name, basestring): + # Optimization for a very common case where the user is + # searching for a tag with one specific name, and we're + # looking at a tag with a different name. + if markup and not markup.prefix and self.name != markup.name: + return False + call_function_with_tag_data = ( isinstance(self.name, Callable) and not isinstance(markup_name, Tag)) diff --git a/lib/bs4_py3/__init__.py b/lib/bs4_py3/__init__.py index 9b99e7e..67b21af 100644 --- a/lib/bs4_py3/__init__.py +++ b/lib/bs4_py3/__init__.py @@ -15,7 +15,7 @@ documentation: http://www.crummy.com/software/BeautifulSoup/bs4/doc/ """ __author__ = "Leonard Richardson (leonardr@segfault.org)" -__version__ = "4.9.2" +__version__ = "4.9.3" __copyright__ = "Copyright (c) 2004-2020 Leonard Richardson" # Use of this source code is governed by the MIT license. __license__ = "MIT" diff --git a/lib/bs4_py3/element.py b/lib/bs4_py3/element.py index 228ab0a..dcbc239 100644 --- a/lib/bs4_py3/element.py +++ b/lib/bs4_py3/element.py @@ -1995,6 +1995,14 @@ class SoupStrainer(object): if isinstance(markup_name, Tag): markup = markup_name markup_attrs = markup + + if isinstance(self.name, str): + # Optimization for a very common case where the user is + # searching for a tag with one specific name, and we're + # looking at a tag with a different name. + if markup and not markup.prefix and self.name != markup.name: + return False + call_function_with_tag_data = ( isinstance(self.name, Callable) and not isinstance(markup_name, Tag))