2323import sys
2424from enum import IntEnum , IntFlag
2525from functools import reduce
26- from typing import Literal , SupportsFloat , SupportsInt , Union
26+ from typing import Any , Literal , SupportsFloat , SupportsInt , Union
2727
2828from . import Image
29+ from ._deprecate import deprecate
2930from ._typing import SupportsRead
3031
3132try :
@@ -233,9 +234,7 @@ def __init__(self, profile: str | SupportsRead[bytes] | core.CmsProfile) -> None
233234 low-level profile object
234235
235236 """
236- self .filename = None
237- self .product_name = None # profile.product_name
238- self .product_info = None # profile.product_info
237+ self .filename : str | None = None
239238
240239 if isinstance (profile , str ):
241240 if sys .platform == "win32" :
@@ -256,6 +255,13 @@ def __init__(self, profile: str | SupportsRead[bytes] | core.CmsProfile) -> None
256255 msg = "Invalid type for Profile" # type: ignore[unreachable]
257256 raise TypeError (msg )
258257
258+ def __getattr__ (self , name : str ) -> Any :
259+ if name in ("product_name" , "product_info" ):
260+ deprecate (f"ImageCms.ImageCmsProfile.{ name } " , 13 )
261+ return None
262+ msg = f"'{ self .__class__ .__name__ } ' object has no attribute '{ name } '"
263+ raise AttributeError (msg )
264+
259265 def tobytes (self ) -> bytes :
260266 """
261267 Returns the profile in a format suitable for embedding in
0 commit comments