mirror of
https://github.com/RGBCube/GitHubWrapper
synced 2025-05-14 13:15:00 +00:00
Move utils.error_from_request to errors.py and fix circular imports
This commit is contained in:
parent
cad7916da6
commit
f71c0db13b
4 changed files with 11 additions and 13 deletions
|
@ -11,8 +11,6 @@ __all__ = (
|
|||
from base64 import b64encode
|
||||
from typing import TYPE_CHECKING, Optional
|
||||
|
||||
from .errors import HTTPError
|
||||
|
||||
if TYPE_CHECKING:
|
||||
from datetime import datetime, timedelta
|
||||
|
||||
|
@ -39,8 +37,3 @@ def repr_dt(time: datetime, /) -> str:
|
|||
|
||||
def bytes_to_b64(content: str, /) -> str:
|
||||
return b64encode(content.encode("utf-8")).decode("ascii")
|
||||
|
||||
|
||||
def error_from_request(request: ClientResponse, /) -> BaseHTTPError:
|
||||
# TODO: Make specific errrors
|
||||
return HTTPError(request)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue