@@ -21,7 +21,7 @@ def _build_parser():
21
21
def _path_exists (path , parser ):
22
22
"""Ensure a given path exists."""
23
23
if path is None or not Path (path ).exists ():
24
- raise parser .error ("Path does not exist: <%s >." % path )
24
+ raise parser .error (f "Path does not exist: <{ path } >." )
25
25
return Path (path ).absolute ()
26
26
27
27
def _min_one (value , parser ):
@@ -46,7 +46,7 @@ def _bids_filter(value):
46
46
if value and Path (value ).exists ():
47
47
return loads (Path (value ).read_text ())
48
48
49
- verstr = 'fMRIPrep v{}' . format ( config .environment .version )
49
+ verstr = f 'fMRIPrep v{ config .environment .version } '
50
50
currentv = Version (config .environment .version )
51
51
is_release = not any ((currentv .is_devrelease , currentv .is_prerelease , currentv .is_postrelease ))
52
52
@@ -360,14 +360,14 @@ def parse_args(args=None, namespace=None):
360
360
361
361
# Ensure input and output folders are not the same
362
362
if output_dir == bids_dir :
363
- config . loggers . cli .error (
363
+ parser .error (
364
364
'The selected output folder is the same as the input BIDS folder. '
365
365
'Please modify the output path (suggestion: %s).'
366
366
% bids_dir / 'derivatives' / ('fmriprep-%s' % version .split ('+' )[0 ])
367
367
)
368
368
369
369
if bids_dir in work_dir .parents :
370
- config . loggers . cli .error (
370
+ parser .error (
371
371
'The selected working directory is a subdirectory of the input BIDS folder. '
372
372
'Please modify the output path.'
373
373
)
0 commit comments