Skip to content

Commit

Permalink
fix: update type hints for Python 3.9 compatibility
Browse files Browse the repository at this point in the history
  • Loading branch information
devin-ai-integration[bot] and jxnl committed Dec 15, 2024
1 parent 68693b0 commit bbfd82c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion instructor/multimodal.py
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ def from_raw_base64(cls, data: str) -> "Image":
decoded: bytes = base64.b64decode(data)
import imghdr

img_type: str | None = imghdr.what(None, decoded)
img_type: Union[str, None] = imghdr.what(None, decoded)

Check failure on line 121 in instructor/multimodal.py

View workflow job for this annotation

GitHub Actions / Ruff (ubuntu-latest)

Ruff (UP007)

instructor/multimodal.py:121:23: UP007 Use `X | Y` for type annotations

Check failure on line 121 in instructor/multimodal.py

View workflow job for this annotation

GitHub Actions / Ruff (ubuntu-latest)

Ruff (UP007)

instructor/multimodal.py:121:23: UP007 Use `X | Y` for type annotations
if img_type:
media_type: str = f"image/{img_type}"
if media_type in VALID_MIME_TYPES:
Expand Down

0 comments on commit bbfd82c

Please sign in to comment.