@@ -248,6 +248,9 @@ def __init__(self, profile: str | SupportsRead[bytes] | core.CmsProfile) -> None
248
248
low-level profile object
249
249
250
250
"""
251
+ self .filename = None
252
+ self .product_name = None # profile.product_name
253
+ self .product_info = None # profile.product_info
251
254
252
255
if isinstance (profile , str ):
253
256
if sys .platform == "win32" :
@@ -256,23 +259,18 @@ def __init__(self, profile: str | SupportsRead[bytes] | core.CmsProfile) -> None
256
259
profile_bytes_path .decode ("ascii" )
257
260
except UnicodeDecodeError :
258
261
with open (profile , "rb" ) as f :
259
- self ._set ( core .profile_frombytes (f .read () ))
262
+ self .profile = core .profile_frombytes (f .read ())
260
263
return
261
- self ._set (core .profile_open (profile ), profile )
264
+ self .filename = profile
265
+ self .profile = core .profile_open (profile )
262
266
elif hasattr (profile , "read" ):
263
- self ._set ( core .profile_frombytes (profile .read () ))
267
+ self .profile = core .profile_frombytes (profile .read ())
264
268
elif isinstance (profile , core .CmsProfile ):
265
- self ._set ( profile )
269
+ self .profile = profile
266
270
else :
267
271
msg = "Invalid type for Profile" # type: ignore[unreachable]
268
272
raise TypeError (msg )
269
273
270
- def _set (self , profile : core .CmsProfile , filename : str | None = None ) -> None :
271
- self .profile = profile
272
- self .filename = filename
273
- self .product_name = None # profile.product_name
274
- self .product_info = None # profile.product_info
275
-
276
274
def tobytes (self ) -> bytes :
277
275
"""
278
276
Returns the profile in a format suitable for embedding in
0 commit comments