Browse Source

[supervise] supression du except socket.gaierror

Maxime Alves LIRMM@home 3 years ago
parent
commit
3ab8af7f74
1 changed files with 4 additions and 9 deletions
  1. 4
    9
      pyheatpump/cli.py

+ 4
- 9
pyheatpump/cli.py View File

7
 import json
7
 import json
8
 import os
8
 import os
9
 import re
9
 import re
10
-import socket
11
 import sys
10
 import sys
12
 import time
11
 import time
13
 import urllib
12
 import urllib
192
         **{'path': get_path}
191
         **{'path': get_path}
193
     }
192
     }
194
 
193
 
195
-    try:
196
-        get_resp = requests.get(
197
-            url=build_url(get_url),
198
-            verify=False
199
-        )
200
-    except socket.gaierror as exc:
201
-        logger.error('Socket error : %s', exc)
202
-        sys.exit(-1)
194
+    get_resp = requests.get(
195
+        url=build_url(get_url),
196
+        verify=False
197
+    )
203
 
198
 
204
     control_data = get_resp.json()
199
     control_data = get_resp.json()
205
     if Heatpump(mac_address).control(control_data):
200
     if Heatpump(mac_address).control(control_data):

Loading…
Cancel
Save