]> git.phdru.name Git - bookmarks_db.git/commitdiff
Fix(bkmk_robot_base): Convert environment parameters to integer
authorOleg Broytman <phd@phdru.name>
Mon, 5 Aug 2024 15:19:26 +0000 (18:19 +0300)
committerOleg Broytman <phd@phdru.name>
Mon, 5 Aug 2024 19:36:54 +0000 (22:36 +0300)
Robots/bkmk_robot_base.py

index 8b8694056e7158e10b4ea467fb586125f153a34a..a7429411b8e46eb81518ac4f1ade76325a42b6f9 100644 (file)
@@ -82,8 +82,13 @@ class robot_base(Robot):
     timeout = 60
 
     def __init__(self, *args, **kw):
+        for attr in 'connect_timeout', 'timeout':
+            value = getattr(self, attr)
+            if not isinstance(value, int):
+                value = int(value)
+                setattr(self, attr, value)
         Robot.__init__(self, *args, **kw)
-        socket.setdefaulttimeout(int(self.timeout))
+        socket.setdefaulttimeout(self.timeout)
 
         global _x_user_agent
         _x_user_agent = '%s %s' % (_x_user_agent, self.version_str())