summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLeonard Richardson <leonardr@segfault.org>2019-11-11 11:41:01 -0500
committerLeonard Richardson <leonardr@segfault.org>2019-11-11 11:41:01 -0500
commit32ccfa3f458c3542569ece5bdcd88513e42a6fe0 (patch)
tree1b69a02aa5f59bf0f1413aaf2159a768fd789d50
parent64753365df3bedd60cde505db792abb20841ada4 (diff)
parent17ca4508af1ee8ad739b4cf8319e2313c91c5c86 (diff)
Fixed a deprecation warning on Python 3.7. Patch by Colin
Watson. [bug=1847592]
-rw-r--r--CHANGELOG8
-rw-r--r--bs4/element.py2
2 files changed, 9 insertions, 1 deletions
diff --git a/CHANGELOG b/CHANGELOG
index 0f14b07..450e8d1 100644
--- a/CHANGELOG
+++ b/CHANGELOG
@@ -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]