Skip to content

Commit

Permalink
fix circular import
Browse files Browse the repository at this point in the history
  • Loading branch information
Wauplin committed Aug 20, 2024
1 parent d298e4f commit f3525e6
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/huggingface_hub/errors.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@

from requests import HTTPError, Response

from .utils._fixes import JSONDecodeError


# HEADERS ERRORS

Expand Down Expand Up @@ -57,6 +55,9 @@ class HfHubHTTPError(HTTPError):
def __init__(self, message: str, response: Optional[Response] = None):
# Parse server information if any.
if response is not None:
# Import here to avoid circular import
from .utils._fixes import JSONDecodeError

self.request_id = response.headers.get("X-Request-Id")
try:
server_data = response.json()
Expand Down

0 comments on commit f3525e6

Please sign in to comment.