Преглед изворни кода

[fix] fix bugs introduced by commit 0a2fde19d031acef80ce5991bc6b41528dbfbf5b from dalf/searchpy4

Alexandre Flament пре 8 година
родитељ
комит
5a9551925d
1 измењених фајлова са 2 додато и 2 уклоњено
  1. 2
    2
      searx/search.py

+ 2
- 2
searx/search.py Прегледај датотеку

@@ -65,7 +65,7 @@ def send_http_request(engine, request_params, start_time, timeout_limit):
65 65
     time_after_request = time()
66 66
     search_duration = time_after_request - start_time
67 67
     if search_duration > timeout_limit + timeout_overhead:
68
-        raise Timeout(response=response)
68
+        raise requests.exceptions.Timeout(response=response)
69 69
 
70 70
     with threading.RLock():
71 71
         # no error : reset the suspend variables
@@ -129,7 +129,7 @@ def search_one_request_safe(engine_name, query, request_params, result_container
129 129
                          "(search duration : {1} s, timeout: {2} s) : {3}"
130 130
                          .format(engine_name, search_duration, timeout_limit, e.__class__.__name__))
131 131
             requests_exception = True
132
-        if (issubclass(e.__class__, requests.exceptions.RequestException)):
132
+        elif (issubclass(e.__class__, requests.exceptions.RequestException)):
133 133
             # other requests exception
134 134
             logger.exception("engine {0} : requests exception"
135 135
                              "(search duration : {1} s, timeout: {2} s) : {3}"