]> git.phdru.name Git - bookmarks_db.git/commitdiff
Fix(Py3): Fix `unescape`
authorOleg Broytman <phd@phdru.name>
Thu, 16 Nov 2023 05:26:52 +0000 (08:26 +0300)
committerOleg Broytman <phd@phdru.name>
Fri, 17 Nov 2023 10:58:35 +0000 (13:58 +0300)
bkmk_objects.py

index b9dabff1e316a66c36d14a9f3d0911f4b60f6b2c..741567039d7763077e1255ef162e6f09bb498e28 100644 (file)
@@ -228,8 +228,13 @@ def quote_title(title):
 
 def unquote_title(title):
     if BKMK_FORMAT == "MOZILLA":
-        from HTMLParser import HTMLParser
-        title = HTMLParser().unescape(
+        try:
+            from HTMLParser import HTMLParser
+        except ImportError:
+            from html import unescape
+        else:
+            unescape = HTMLParser().unescape
+        title = unescape(
             title.replace("&amp;", '&'))
         title = title.replace("&#39;", "'")
     return title