Skip to content

Commit

Permalink
Removed FileDescriptor
Browse files Browse the repository at this point in the history
  • Loading branch information
radarhere committed Feb 10, 2024
1 parent 958a651 commit 517b797
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 6 deletions.
6 changes: 2 additions & 4 deletions src/PIL/GdImageFile.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ class is not registered for use with :py:func:`PIL.Image.open()`. To open a
from . import ImageFile, ImagePalette, UnidentifiedImageError
from ._binary import i16be as i16
from ._binary import i32be as i32
from ._typing import FileDescriptor, StrOrBytesPath
from ._typing import StrOrBytesPath


class GdImageFile(ImageFile.ImageFile):
Expand Down Expand Up @@ -81,9 +81,7 @@ def _open(self) -> None:
]


def open(
fp: StrOrBytesPath | FileDescriptor | IO[bytes], mode: str = "r"
) -> GdImageFile:
def open(fp: StrOrBytesPath | IO[bytes], mode: str = "r") -> GdImageFile:
"""
Load texture from a GD image file.
Expand Down
3 changes: 1 addition & 2 deletions src/PIL/_typing.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,7 @@ class SupportsRead(Protocol[_T_co]):
def read(self, __length: int = ...) -> _T_co: ...


FileDescriptor = int
StrOrBytesPath = Union[str, bytes, "os.PathLike[str]", "os.PathLike[bytes]"]


__all__ = ["FileDescriptor", "TypeGuard", "StrOrBytesPath", "SupportsRead"]
__all__ = ["TypeGuard", "StrOrBytesPath", "SupportsRead"]

0 comments on commit 517b797

Please sign in to comment.