File tree Expand file tree Collapse file tree 2 files changed +8
-8
lines changed Expand file tree Collapse file tree 2 files changed +8
-8
lines changed Original file line number Diff line number Diff line change @@ -325,15 +325,15 @@ class NiftiExtension(ty.Generic[T]):
325325 """
326326
327327 code : int
328- encoding : ty . Optional [ str ] = None
328+ encoding : str | None = None
329329 _content : bytes
330- _object : ty . Optional [ T ] = None
330+ _object : T | None = None
331331
332332 def __init__ (
333333 self ,
334- code : ty . Union [ int , str ] ,
334+ code : int | str ,
335335 content : bytes = b'' ,
336- object : ty . Optional [ T ] = None ,
336+ object : T | None = None ,
337337 ) -> None :
338338 """
339339 Parameters
@@ -565,9 +565,9 @@ class Nifti1DicomExtension(Nifti1Extension[DicomDataset]):
565565
566566 def __init__ (
567567 self ,
568- code : ty . Union [ int , str ] ,
569- content : ty . Union [ bytes , DicomDataset , None ] = None ,
570- parent_hdr : ty . Optional [ Nifti1Header ] = None ,
568+ code : int | str ,
569+ content : bytes | DicomDataset | None = None ,
570+ parent_hdr : Nifti1Header | None = None ,
571571 ) -> None :
572572 """
573573 Parameters
Original file line number Diff line number Diff line change @@ -1239,7 +1239,7 @@ def test_extension_content_access():
12391239 assert ext .text == '123'
12401240
12411241 # Test that encoding errors are caught
1242- ascii_ext = Nifti1Extension ('comment' , 'hôpital' .encode ('utf-8' ))
1242+ ascii_ext = Nifti1Extension ('comment' , 'hôpital' .encode ())
12431243 ascii_ext .encoding = 'ascii'
12441244 with pytest .raises (UnicodeDecodeError ):
12451245 ascii_ext .text
You can’t perform that action at this time.
0 commit comments