@@ -250,7 +250,9 @@ def add_transfer_syntax(self, syntax: None | str | bytes | UID) -> None:
250250 if syntax is None :
251251 return
252252
253- if isinstance (syntax , str ): # includes UID
253+ if isinstance (syntax , UID ):
254+ pass
255+ elif isinstance (syntax , str ):
254256 syntax = UID (syntax )
255257 elif isinstance (syntax , bytes ):
256258 syntax = UID (syntax .decode ("ascii" ))
@@ -264,15 +266,16 @@ def add_transfer_syntax(self, syntax: None | str | bytes | UID) -> None:
264266
265267 # If the transfer syntax is rejected we may receive an empty str
266268 if syntax not in self ._transfer_syntax and syntax != "" :
267- if not syntax .is_valid :
269+ if not syntax .is_valid : # type: ignore[union-attr] # FIXME
268270 LOGGER .warning (
269- f"A non-conformant UID has been added to 'transfer_syntax': '{ syntax } '"
271+ "A non-conformant UID has been added to 'transfer_syntax': "
272+ f"'{ syntax } '" # type: ignore[str-bytes-safe] # FIXME
270273 )
271274
272- if not syntax .is_private and not syntax .is_transfer_syntax :
275+ if not syntax .is_private and not syntax .is_transfer_syntax : # type: ignore[union-attr] # FIXME
273276 LOGGER .warning (
274277 "A UID has been added to 'transfer_syntax' that is not a known "
275- f"public transfer syntax: '{ syntax } '"
278+ f"public transfer syntax: '{ syntax } '" # type: ignore[str-bytes-safe] # FIXME
276279 )
277280
278281 self ._transfer_syntax .append (syntax )
@@ -365,7 +368,7 @@ def __ne__(self, other: object) -> bool:
365368
366369 def __repr__ (self ) -> str :
367370 """Representation of the Presentation Context."""
368- return cast (UID , self .abstract_syntax ).name
371+ return cast (UID , self .abstract_syntax ).name # type: ignore[no-any-return] # FIXME
369372
370373 @property
371374 def scp_role (self ) -> None | bool :
0 commit comments