From 5a9551925d4e3fea0ea5ec6d50733803a22b6445 Mon Sep 17 00:00:00 2001 From: Alexandre Flament Date: Fri, 30 Dec 2016 18:08:48 +0100 Subject: [PATCH] [fix] fix bugs introduced by commit 0a2fde19d031acef80ce5991bc6b41528dbfbf5b from dalf/searchpy4 --- searx/search.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/searx/search.py b/searx/search.py index 021dba031..e0f0cfd6a 100644 --- a/searx/search.py +++ b/searx/search.py @@ -65,7 +65,7 @@ def send_http_request(engine, request_params, start_time, timeout_limit): time_after_request = time() search_duration = time_after_request - start_time if search_duration > timeout_limit + timeout_overhead: - raise Timeout(response=response) + raise requests.exceptions.Timeout(response=response) with threading.RLock(): # no error : reset the suspend variables @@ -129,7 +129,7 @@ def search_one_request_safe(engine_name, query, request_params, result_container "(search duration : {1} s, timeout: {2} s) : {3}" .format(engine_name, search_duration, timeout_limit, e.__class__.__name__)) requests_exception = True - if (issubclass(e.__class__, requests.exceptions.RequestException)): + elif (issubclass(e.__class__, requests.exceptions.RequestException)): # other requests exception logger.exception("engine {0} : requests exception" "(search duration : {1} s, timeout: {2} s) : {3}"