File tree Expand file tree Collapse file tree 1 file changed +7
-2
lines changed
Expand file tree Collapse file tree 1 file changed +7
-2
lines changed Original file line number Diff line number Diff line change @@ -114,6 +114,11 @@ def _parse_header(self):
114114 filenames = sorted (os .listdir (self .dirname ))
115115 dirname = self .dirname
116116 else :
117+ if not os .path .isfile (self .filename ):
118+ raise ValueError (f'Provided Filename is not a file: '
119+ f'{ self .filename } . If you want to provide a '
120+ f'directory use the `dirname` keyword' )
121+
117122 dirname , fname = os .path .split (self .filename )
118123 filenames = [fname ]
119124
@@ -581,8 +586,8 @@ def scan_ncs_files(self, ncs_filenames):
581586 # If there is only one NcsSections structure in the set of ncs files, there should only
582587 # be one entry. Otherwise this is presently unsupported.
583588 if len (revSectMap ) > 1 :
584- raise IOError ('ncs files have {} different sections structures. Unsupported.' . format (
585- len ( revSectMap )) )
589+ raise IOError (f 'ncs files have { len ( revSectMap ) } different sections '
590+ f'structures. Unsupported configuration.' )
586591
587592 seg_time_limits = SegmentTimeLimits (nb_segment = len (lastNcsSections .sects ),
588593 t_start = [], t_stop = [], length = [],
You can’t perform that action at this time.
0 commit comments