1
0
Fork 1
mirror of https://github.com/thatmattlove/hyperglass.git synced 2026-01-17 08:48:05 +00:00

Fix call to deprecated httpx.StatusCodes

This commit is contained in:
thatmattlove 2021-09-16 15:48:02 -07:00
parent bb1e66c2ef
commit 725631568e

View file

@ -11,7 +11,6 @@ from socket import gaierror
# Third Party
import httpx
from httpx import StatusCode
# Project
from hyperglass.log import log
@ -295,7 +294,7 @@ class BaseExternal:
response = self._session.request(**request)
if response.status_code not in range(200, 300):
status = StatusCode(response.status_code)
status = httpx.codes(response.status_code)
error = self._parse_response(response)
raise self._exception(
f'{status.name.replace("_", " ")}: {error}', level="danger"