diff options
-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] |