diff options
Diffstat (limited to 'bs4/dammit.py')
-rw-r--r-- | bs4/dammit.py | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/bs4/dammit.py b/bs4/dammit.py index 9b6e356..cec0809 100644 --- a/bs4/dammit.py +++ b/bs4/dammit.py @@ -347,7 +347,7 @@ class UnicodeDammit: self.tried_encodings = [] self.contains_replacement_characters = False self.is_html = is_html - + self.log = logging.getLogger(__name__) self.detector = EncodingDetector( markup, override_encodings, is_html, exclude_encodings) @@ -377,9 +377,10 @@ class UnicodeDammit: if encoding != "ascii": u = self._convert_from(encoding, "replace") if u is not None: - logging.warning( + self.log.warn( "Some characters could not be decoded, and were " - "replaced with REPLACEMENT CHARACTER.") + "replaced with REPLACEMENT CHARACTER." + ) self.contains_replacement_characters = True break |