def set_timeout(self, timeout): self.timeout = int(timeout) self.curl_handler.setopt(pycurl.CONNECTTIMEOUT_MS, self.timeout) self.curl_handler.setopt(pycurl.TIMEOUT_MS, self.timeout)