From: Oleg Broytman Date: Mon, 5 Aug 2024 15:19:26 +0000 (+0300) Subject: Fix(bkmk_robot_base): Convert environment parameters to integer X-Git-Tag: 5.5.0~3 X-Git-Url: https://git.phdru.name/?a=commitdiff_plain;h=d5c9dacf575ba95b69857f8fe3197a6418601aa8;p=bookmarks_db.git Fix(bkmk_robot_base): Convert environment parameters to integer --- diff --git a/Robots/bkmk_robot_base.py b/Robots/bkmk_robot_base.py index 8b86940..a742941 100644 --- a/Robots/bkmk_robot_base.py +++ b/Robots/bkmk_robot_base.py @@ -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())