@@ -294,12 +294,9 @@ def validate_filenames(self, imaker, params):
294294 new_dtype = np .float32
295295 # some Image types accept only a few datatypes and shapes
296296 # so we check and force a type change to a compatible dtype
297- try :
298- supported_dtypes = supported_np_types (img .header_class ())
299- if new_dtype not in supported_dtypes :
300- new_dtype = supported_dtypes .pop ()
301- except :
302- pass
297+ supported_dtypes = supported_np_types (img .header_class ())
298+ if new_dtype not in supported_dtypes :
299+ new_dtype = supported_dtypes .pop ()
303300 img .set_data_dtype (new_dtype )
304301 # The bytesio_round_trip helper tests bytesio load / save via file_map
305302 rt_img = bytesio_round_trip (img )
@@ -370,19 +367,13 @@ def obj_params(self):
370367 aff = np .diag ([1 , 2 , 3 , 1 ])
371368
372369 # Try to retrieve allowed dims
373- try :
374- supported_dims = supported_dimensions (self .header_maker ())
375- self .example_shapes = (shape for shape in self .example_shapes
376- if len (shape ) in supported_dims )
377- except :
378- pass
370+ supported_dims = supported_dimensions (self .header_maker ())
371+ self .example_shapes = (shape for shape in self .example_shapes
372+ if len (shape ) in supported_dims )
379373 # Try to retrieve allowed dtypes
380- try :
381- supported_dtypes = supported_np_types (self .header_maker ())
382- self .example_dtypes = (dtype for dtype in self .example_dtypes
383- if dtype in supported_dtypes )
384- except :
385- pass
374+ supported_dtypes = supported_np_types (self .header_maker ())
375+ self .example_dtypes = (dtype for dtype in self .example_dtypes
376+ if dtype in supported_dtypes )
386377
387378 def make_imaker (arr , aff , header = None ):
388379 return lambda : self .image_maker (arr , aff , header )
0 commit comments