Skip to content

Commit 4051302

Browse files
authored
Merge pull request #113 from radarhere/type-hints-replace-io.BytesIO
2 parents 958a651 + 517b797 commit 4051302

2 files changed

Lines changed: 3 additions & 6 deletions

File tree

src/PIL/GdImageFile.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ class is not registered for use with :py:func:`PIL.Image.open()`. To open a
3232
from . import ImageFile, ImagePalette, UnidentifiedImageError
3333
from ._binary import i16be as i16
3434
from ._binary import i32be as i32
35-
from ._typing import FileDescriptor, StrOrBytesPath
35+
from ._typing import StrOrBytesPath
3636

3737

3838
class GdImageFile(ImageFile.ImageFile):
@@ -81,9 +81,7 @@ def _open(self) -> None:
8181
]
8282

8383

84-
def open(
85-
fp: StrOrBytesPath | FileDescriptor | IO[bytes], mode: str = "r"
86-
) -> GdImageFile:
84+
def open(fp: StrOrBytesPath | IO[bytes], mode: str = "r") -> GdImageFile:
8785
"""
8886
Load texture from a GD image file.
8987

src/PIL/_typing.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,7 @@ class SupportsRead(Protocol[_T_co]):
2727
def read(self, __length: int = ...) -> _T_co: ...
2828

2929

30-
FileDescriptor = int
3130
StrOrBytesPath = Union[str, bytes, "os.PathLike[str]", "os.PathLike[bytes]"]
3231

3332

34-
__all__ = ["FileDescriptor", "TypeGuard", "StrOrBytesPath", "SupportsRead"]
33+
__all__ = ["TypeGuard", "StrOrBytesPath", "SupportsRead"]

0 commit comments

Comments
 (0)