Skip to content

Commit

Permalink
refactor: use HTTPStatus
Browse files Browse the repository at this point in the history
  • Loading branch information
jkglasbrenner committed Oct 4, 2024
1 parent a831a70 commit b38d254
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/dioptra/client/sessions.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
# ACCESS THE FULL CC BY 4.0 LICENSE HERE:
# https://creativecommons.org/licenses/by/4.0/legalcode
from abc import ABC, abstractmethod
from http import HTTPStatus
from typing import Any, Callable, Final, Generic, TypeVar, cast
from urllib.parse import urlparse, urlunparse

Expand Down Expand Up @@ -135,7 +136,7 @@ def is_not_2xx(status_code: int) -> bool:
Returns:
True if the status code is not in the 2xx range, False otherwise.
"""
return status_code < 200 or status_code >= 300
return status_code < HTTPStatus.OK or status_code >= HTTPStatus.MULTIPLE_CHOICES


class BaseDioptraRequestsSession(DioptraSession[T], ABC, Generic[T]):
Expand Down

0 comments on commit b38d254

Please sign in to comment.