From e146ac995fdf0f2d4911908ba7ff0230cb182054 Mon Sep 17 00:00:00 2001 From: Oleg Broytman Date: Sat, 11 Nov 2023 23:10:39 +0300 Subject: [PATCH] Fix(Py3): Fix `htmlentities` import --- parse_html/bkmk_parse_html.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/parse_html/bkmk_parse_html.py b/parse_html/bkmk_parse_html.py index 69d9035..ddfad27 100644 --- a/parse_html/bkmk_parse_html.py +++ b/parse_html/bkmk_parse_html.py @@ -14,7 +14,10 @@ __all__ = ['parse_html', 'parse_filename', 'universal_charset'] import codecs import os import re -from htmlentitydefs import name2codepoint +try: + from html.entities import name2codepoint +except ImportError: + from htmlentitydefs import name2codepoint from compat import unicode, unichr -- 2.39.5