mirror of
https://github.com/wakatime/sublime-wakatime.git
synced 2023-08-10 21:13:02 +03:00
retry httperrors in py2 without ssl
This commit is contained in:
parent
6fa1321a95
commit
389c84673e
14
WakaTime.py
14
WakaTime.py
@ -837,6 +837,18 @@ def request(url, last_modified=None):
|
||||
except HTTPError as err:
|
||||
if err.code == 304:
|
||||
return None, None, 304
|
||||
if is_py2:
|
||||
ssl._create_default_https_context = ssl._create_unverified_context
|
||||
try:
|
||||
resp = urlopen(url)
|
||||
headers = dict(resp.getheaders()) if is_py2 else resp.headers
|
||||
return headers, resp.read(), resp.getcode()
|
||||
except HTTPError as err:
|
||||
if err.code == 304:
|
||||
return None, None, 304
|
||||
raise
|
||||
except IOError:
|
||||
raise
|
||||
raise
|
||||
except IOError:
|
||||
if is_py2:
|
||||
@ -849,6 +861,8 @@ def request(url, last_modified=None):
|
||||
if err.code == 304:
|
||||
return None, None, 304
|
||||
raise
|
||||
except IOError:
|
||||
raise
|
||||
raise
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user