Skip to content

Commit

Permalink
Merge pull request #8187 from neutrinoceros/bug/compat/numpy1.20
Browse files Browse the repository at this point in the history
  • Loading branch information
hugovk committed Jul 2, 2024
2 parents f3719a9 + ce6fb12 commit ececa9d
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions src/PIL/_typing.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,15 @@

import os
import sys
from typing import Any, Protocol, Sequence, TypeVar, Union
from typing import TYPE_CHECKING, Any, Protocol, Sequence, TypeVar, Union

try:
import numpy.typing as npt
if TYPE_CHECKING:
try:
import numpy.typing as npt

NumpyArray = npt.NDArray[Any]
except ImportError:
pass
NumpyArray = npt.NDArray[Any] # requires numpy>=1.21
except (ImportError, AttributeError):
pass

if sys.version_info >= (3, 10):
from typing import TypeGuard
Expand Down

0 comments on commit ececa9d

Please sign in to comment.