forked from mirrors/thatmattlove-hyperglass
Fix call to deprecated httpx.StatusCodes
This commit is contained in:
parent
bb1e66c2ef
commit
725631568e
1 changed files with 1 additions and 2 deletions
3
hyperglass/external/_base.py
vendored
3
hyperglass/external/_base.py
vendored
|
|
@ -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"
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue