Skip to content

Commit

Permalink
Merge pull request #7727 from radarhere/type_hints
Browse files Browse the repository at this point in the history
  • Loading branch information
hugovk committed Jan 17, 2024
2 parents 20830c5 + d8c7af0 commit 1e00c03
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/PIL/GdImageFile.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@ class is not registered for use with :py:func:`PIL.Image.open()`. To open a
"""
from __future__ import annotations

from io import BytesIO

from . import ImageFile, ImagePalette, UnidentifiedImageError
from ._binary import i16be as i16
from ._binary import i32be as i32
Expand All @@ -43,8 +45,10 @@ class GdImageFile(ImageFile.ImageFile):
format = "GD"
format_description = "GD uncompressed images"

def _open(self):
def _open(self) -> None:
# Header
assert self.fp is not None

s = self.fp.read(1037)

if i16(s) not in [65534, 65535]:
Expand Down Expand Up @@ -76,7 +80,7 @@ def _open(self):
]


def open(fp, mode="r"):
def open(fp: BytesIO, mode: str = "r") -> GdImageFile:
"""
Load texture from a GD image file.
Expand Down

0 comments on commit 1e00c03

Please sign in to comment.