mirror of
https://github.com/python-pillow/Pillow.git
synced 2025-07-27 08:30:05 +03:00
Moved type hints
This commit is contained in:
parent
51cb7c7ea8
commit
31498f3407
|
@ -227,9 +227,6 @@ _FLAGS = {
|
||||||
|
|
||||||
|
|
||||||
class ImageCmsProfile:
|
class ImageCmsProfile:
|
||||||
profile: core.CmsProfile
|
|
||||||
filename: str | None
|
|
||||||
|
|
||||||
def __init__(self, profile: str | SupportsRead[bytes] | core.CmsProfile) -> None:
|
def __init__(self, profile: str | SupportsRead[bytes] | core.CmsProfile) -> None:
|
||||||
"""
|
"""
|
||||||
:param profile: Either a string representing a filename,
|
:param profile: Either a string representing a filename,
|
||||||
|
@ -237,7 +234,7 @@ class ImageCmsProfile:
|
||||||
low-level profile object
|
low-level profile object
|
||||||
|
|
||||||
"""
|
"""
|
||||||
self.filename = None
|
self.filename: str | None = None
|
||||||
|
|
||||||
if isinstance(profile, str):
|
if isinstance(profile, str):
|
||||||
if sys.platform == "win32":
|
if sys.platform == "win32":
|
||||||
|
@ -249,7 +246,7 @@ class ImageCmsProfile:
|
||||||
self.profile = core.profile_frombytes(f.read())
|
self.profile = core.profile_frombytes(f.read())
|
||||||
return
|
return
|
||||||
self.filename = profile
|
self.filename = profile
|
||||||
self.profile = core.profile_open(profile)
|
self.profile: core.CmsProfile = core.profile_open(profile)
|
||||||
elif hasattr(profile, "read"):
|
elif hasattr(profile, "read"):
|
||||||
self.profile = core.profile_frombytes(profile.read())
|
self.profile = core.profile_frombytes(profile.read())
|
||||||
elif isinstance(profile, core.CmsProfile):
|
elif isinstance(profile, core.CmsProfile):
|
||||||
|
|
Loading…
Reference in New Issue
Block a user