From d5c9dacf575ba95b69857f8fe3197a6418601aa8 Mon Sep 17 00:00:00 2001 From: Oleg Broytman Date: Mon, 5 Aug 2024 18:19:26 +0300 Subject: [PATCH] Fix(bkmk_robot_base): Convert environment parameters to integer --- Robots/bkmk_robot_base.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) 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()) -- 2.39.5