Use http.HTTPStatus in components/[gh]* (#58246)

This commit is contained in:
Ville Skyttä 2021-10-23 21:34:53 +03:00 committed by GitHub
parent 583ae3c953
commit b52c5c82b1
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
38 changed files with 272 additions and 247 deletions

View file

@ -3,6 +3,7 @@ from __future__ import annotations
import asyncio
from functools import partial
from http import HTTPStatus
import logging
from aiohttp import client_exceptions
@ -11,7 +12,6 @@ import async_timeout
import slugify as unicode_slug
from homeassistant import core
from homeassistant.const import HTTP_INTERNAL_SERVER_ERROR
from homeassistant.exceptions import ConfigEntryNotReady
from homeassistant.helpers import aiohttp_client
@ -148,7 +148,7 @@ class HueBridge:
# We only retry if it's a server error. So raise on all 4XX errors.
if (
isinstance(err, client_exceptions.ClientResponseError)
and err.status < HTTP_INTERNAL_SERVER_ERROR
and err.status < HTTPStatus.INTERNAL_SERVER_ERROR
):
raise