diff options
author | Leonard Richardson <leonardr@segfault.org> | 2019-11-11 11:41:01 -0500 |
---|---|---|
committer | Leonard Richardson <leonardr@segfault.org> | 2019-11-11 11:41:01 -0500 |
commit | 32ccfa3f458c3542569ece5bdcd88513e42a6fe0 (patch) | |
tree | 1b69a02aa5f59bf0f1413aaf2159a768fd789d50 | |
parent | 64753365df3bedd60cde505db792abb20841ada4 (diff) | |
parent | 17ca4508af1ee8ad739b4cf8319e2313c91c5c86 (diff) |
Fixed a deprecation warning on Python 3.7. Patch by Colin
Watson. [bug=1847592]
-rw-r--r-- | CHANGELOG | 8 | ||||
-rw-r--r-- | bs4/element.py | 2 |
2 files changed, 9 insertions, 1 deletions
@@ -1,3 +1,11 @@ += Unreleased + +* Fixed a deprecation warning on Python 3.7. Patch by Colin + Watson. [bug=1847592] + +* Added a Chinese translation by Deron Wang and a Brazilian Portuguese + translation by Cezar Peixeiro to the repository. + = 4.8.1 (20191006) * When the html.parser or html5lib parsers are in use, Beautiful Soup diff --git a/bs4/element.py b/bs4/element.py index 2001ad5..8684870 100644 --- a/bs4/element.py +++ b/bs4/element.py @@ -163,7 +163,7 @@ class PageElement(object): c = XMLFormatter else: c = HTMLFormatter - if callable(formatter): + if isinstance(formatter, Callable): return c(entity_substitution=formatter) return c.REGISTRY[formatter] |