]> git.phdru.name Git - bookmarks_db.git/commitdiff
Fix(Py3): Fix `check_url.py`
authorOleg Broytman <phd@phdru.name>
Wed, 15 Nov 2023 21:28:08 +0000 (00:28 +0300)
committerOleg Broytman <phd@phdru.name>
Fri, 17 Nov 2023 10:58:35 +0000 (13:58 +0300)
check_url.py

index 2da9d4da7099e751b161b430df1e94428d02f4bc..bb13be23a59bead68130405ffd224b12225c14e2 100755 (executable)
@@ -9,21 +9,23 @@ __copyright__ = "Copyright (C) 2010-2023 PhiloSoft Design"
 __license__ = "GNU GPL"
 
 import sys
-import httplib
 
 from bkmk_objects import Bookmark
 from Writers.bkmk_wflad import strftime
 
-HTTP = httplib.HTTP
+try:
+    import httplib
+except ImportError:
+    pass
+else:
+    HTTP = httplib.HTTP
 
+    class MyHTTP(HTTP):
+        def _setup(self, conn):
+            HTTP._setup(self, conn)
+            self.set_debuglevel(1)
 
-class MyHTTP(HTTP):
-    def _setup(self, conn):
-        HTTP._setup(self, conn)
-        self.set_debuglevel(1)
-
-
-httplib.HTTP = MyHTTP
+    httplib.HTTP = MyHTTP
 
 
 def run():