Skip to content

Commit

Permalink
add type hints to ImageCms.get_display_profile
Browse files Browse the repository at this point in the history
  • Loading branch information
nulano committed Dec 31, 2023
1 parent c3f4d46 commit b14fd40
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/PIL/ImageCms.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@

import sys
from enum import IntEnum
from typing import BinaryIO
from typing import BinaryIO, SupportsInt

from . import Image

Expand Down Expand Up @@ -263,7 +263,7 @@ def apply_in_place(self, im: Image.Image) -> Image.Image:
return im


def get_display_profile(handle=None):
def get_display_profile(handle: SupportsInt | None = None) -> ImageCmsProfile | None:
"""
(experimental) Fetches the profile for the current display device.
Expand All @@ -276,9 +276,9 @@ def get_display_profile(handle=None):
from . import ImageWin

if isinstance(handle, ImageWin.HDC):
profile = core.get_display_profile_win32(handle, 1)
profile = core.get_display_profile_win32(int(handle), 1)
else:
profile = core.get_display_profile_win32(handle or 0)
profile = core.get_display_profile_win32(int(handle or 0))
if profile is None:
return None
return ImageCmsProfile(profile)
Expand Down

0 comments on commit b14fd40

Please sign in to comment.