8000 Merge branch 'main' into context_manager · python-pillow/Pillow@52acc1c · GitHub
[go: up one dir, main page]

Skip to content

Commit 52acc1c

Browse files
committed
Merge branch 'main' into context_manager
2 parents 55fe987 + 60b5131 commit 52acc1c

17 files changed

+35
-25
lines changed

Tests/test_file_tiff.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -118,8 +118,6 @@ def test_bigtiff(self, tmp_path: Path) -> None:
118118
assert_image_equal_tofile(im, "Tests/images/hopper.tif")
119119

120120
with Image.open("Tests/images/hopper_bigtiff.tif") as im:
121-
assert isinstance(im, TiffImagePlugin.TiffImageFile)
122-
123121
outfile = tmp_path / "temp.tif"
124122
assert isinstance(im, TiffImagePlugin.TiffImageFile)
125123
im.save(outfile, save_all=True, append_images=[im], tiffinfo=im.tag_v2)

src/PIL/GifImagePlugin.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131
import subprocess
3232
from enum import IntEnum
3333
from functools import cached_property
34-
from typing import IO, TYPE_CHECKING, Any, Literal, NamedTuple, Union, cast
34+
from typing import IO, Any, Literal, NamedTuple, Union, cast
3535

3636
from . import (
3737
Image,
@@ -47,6 +47,7 @@
4747
from ._binary import o16le as o16
4848
from ._util import DeferredError
4949

50+
TYPE_CHECKING = False
5051
if TYPE_CHECKING:
5152
from . import _imaging
5253
from ._typing import Buffer

src/PIL/Image.py

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -41,14 +41,7 @@
4141
from collections.abc import Callable, Iterator, MutableMapping, Sequence
4242
from enum import IntEnum
4343
from types import ModuleType
44-
from typing import (
45-
IO,
46-
TYPE_CHECKING,
47-
Any,
48-
Literal,
49-
Protocol,
50-
cast,
51-
)
44+
from typing import IO, Any, Literal, Protocol, cast
5245

5346
# VERSION was removed in Pillow 6.0.0.
5447
# PILLOW_VERSION was removed in Pillow 9.0.0.
@@ -218,6 +211,7 @@ class Quantize(IntEnum):
218211
# --------------------------------------------------------------------
219212
# Registries
220213

214+
TYPE_CHECKING = False
221215
if TYPE_CHECKING:
222216
import mmap
223217
from xml.etree.ElementTree import Element

src/PIL/ImageDraw.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@
3535
import struct
3636
from collections.abc import Sequence
3737
from types import ModuleType
38-
from typing import TYPE_CHECKING, Any, AnyStr, Callable, Union, cast
38+
from typing import Any, AnyStr, Callable, Union, cast
3939

4040
from . import Image, ImageColor
4141
from ._deprecate import deprecate
@@ -44,6 +44,7 @@
4444
# experimental access to the outline API
4545
Outline: Callable[[], Image.core._Outline] = Image.core.outline
4646

47+
TYPE_CHECKING = False
4748
if TYPE_CHECKING:
4849
from . import ImageDraw2, ImageFont
4950

src/PIL/ImageFile.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,12 +34,13 @@
3434
import logging
3535
import os
3636
import struct
37-
from typing import IO, TYPE_CHECKING, Any, NamedTuple, cast
37+
from typing import IO, Any, NamedTuple, cast
3838

3939
from . import ExifTags, Image
4040
from ._deprecate import deprecate
4141
from ._util import DeferredError, is_path
4242

43+
TYPE_CHECKING = False
4344
if TYPE_CHECKING:
4445
from ._typing import StrOrBytesPath
4546

src/PIL/ImageFilter.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,9 @@
2020
import functools
2121
from collections.abc import Sequence
2222
from types import ModuleType
23-
from typing import TYPE_CHECKING, Any, Callable, cast
23+
from typing import Any, Callable, cast
2424

25+
TYPE_CHECKING = False
2526
if TYPE_CHECKING:
2627
from . import _imaging
2728
from ._typing import NumpyArray

src/PIL/ImageFont.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,12 +34,13 @@
3434
from enum import IntEnum
3535
from io import BytesIO
3636
from types import ModuleType
37-
from typing import IO, TYPE_CHECKING, Any, BinaryIO, TypedDict, cast
37+
from typing import IO, Any, BinaryIO, TypedDict, cast
3838

3939
from . import Image, features
4040
from ._typing import StrOrBytesPath
4141
from ._util import DeferredError, is_path
4242

43+
TYPE_CHECKING = False
4344
if TYPE_CHECKING:
4445
from . import ImageFile
4546
from ._imaging import ImagingFont

src/PIL/ImagePalette.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,11 @@
1919

2020
import array
2121
from collections.abc import Sequence
22-
from typing import IO, TYPE_CHECKING
22+
from typing import IO
2323

2424
from . import GimpGradientFile, GimpPaletteFile, ImageColor, PaletteFile
2525

26+
TYPE_CHECKING = False
2627
if TYPE_CHECKING:
2728
from . import Image
2829

src/PIL/ImageQt.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,11 +19,12 @@
1919

2020
import sys
2121
from io import BytesIO
22-
from typing import TYPE_CHECKING, Any, Callable, Union
22+
from typing import Any, Callable, Union
2323

2424
from . import Image
2525
from ._util import is_path
2626

27+
TYPE_CHECKING = False
2728
if TYPE_CHECKING:
2829
import PyQt6
2930
import PySide6

src/PIL/ImageTk.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,10 +28,11 @@
2828

2929
import tkinter
3030
from io import BytesIO
31-
from typing import TYPE_CHECKING, Any
31+
from typing import Any
3232

3333
from . import Image, ImageFile
3434

35+
TYPE_CHECKING = False
3536
if TYPE_CHECKING:
3637
from ._typing import CapsuleType
3738

0 commit comments

Comments
 (0)
0