Skip to content

Commit 7ecec06

Browse files
authored
Merge pull request #4926 from Flamefire/httperror
Catch `HTTPException` when doing GitHub API request
2 parents 171de9b + 544fab2 commit 7ecec06

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

easybuild/tools/github.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@
4444
import tempfile
4545
import time
4646
from datetime import datetime, timedelta
47+
from http.client import HTTPException
4748
from string import ascii_letters
4849
from urllib.request import HTTPError, URLError, urlopen
4950

@@ -281,7 +282,7 @@ def github_api_get_request(request_f, github_user=None, token=None, **kwargs):
281282

282283
try:
283284
status, data = url.get(**kwargs)
284-
except socket.gaierror as err:
285+
except (socket.gaierror, HTTPException) as err:
285286
_log.warning("Error occurred while performing get request: %s", err)
286287
status, data = 0, None
287288

0 commit comments

Comments
 (0)