Skip to content

Commit 1788ab7

Browse files
authored
Do not import type checking (#8854)
2 parents cb061f7 + 867c477 commit 1788ab7

File tree

4 files changed

+6
-4
lines changed

4 files changed

+6
-4
lines changed

Tests/test_image_array.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
from __future__ import annotations
22

3-
from typing import TYPE_CHECKING, Any
3+
from typing import Any
44

55
import pytest
66
from packaging.version import parse as parse_version
@@ -13,6 +13,7 @@
1313

1414
im = hopper().resize((128, 100))
1515

16+
TYPE_CHECKING = False
1617
if TYPE_CHECKING:
1718
import numpy.typing as npt
1819

Tests/test_numpy.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
from __future__ import annotations
22

33
import warnings
4-
from typing import TYPE_CHECKING
54

65
import pytest
76

87
from PIL import Image, _typing
98

109
from .helper import assert_deep_equal, assert_image, hopper, skip_unless_feature
1110

11+
TYPE_CHECKING = False
1212
if TYPE_CHECKING:
1313
import numpy
1414
import numpy.typing as npt

Tests/test_qt_image_qapplication.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,15 @@
11
from __future__ import annotations
22

33
from pathlib import Path
4-
from typing import TYPE_CHECKING, Union
4+
from typing import Union
55

66
import pytest
77

88
from PIL import Image, ImageQt
99

1010
from .helper import assert_image_equal_tofile, assert_image_similar, hopper
1111

12+
TYPE_CHECKING = False
1213
if TYPE_CHECKING:
1314
import PyQt6
1415
import PySide6

docs/dater.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@
88

99
import re
1010
import subprocess
11-
from typing import TYPE_CHECKING
1211

12+
TYPE_CHECKING = False
1313
if TYPE_CHECKING:
1414
from sphinx.application import Sphinx
1515

0 commit comments

Comments
 (0)