Skip to content

Commit a0cdd84

Browse files
oestebanmgxd
andauthored
Apply suggestions from code review
Co-Authored-By: Mathias Goncalves <[email protected]>
1 parent 8a0bf9d commit a0cdd84

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

fmriprep/cli/parser.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ def _build_parser():
2121
def _path_exists(path, parser):
2222
"""Ensure a given path exists."""
2323
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}>.")
2525
return Path(path).absolute()
2626

2727
def _min_one(value, parser):
@@ -46,7 +46,7 @@ def _bids_filter(value):
4646
if value and Path(value).exists():
4747
return loads(Path(value).read_text())
4848

49-
verstr = 'fMRIPrep v{}'.format(config.environment.version)
49+
verstr = f'fMRIPrep v{config.environment.version}'
5050
currentv = Version(config.environment.version)
5151
is_release = not any((currentv.is_devrelease, currentv.is_prerelease, currentv.is_postrelease))
5252

@@ -360,14 +360,14 @@ def parse_args(args=None, namespace=None):
360360

361361
# Ensure input and output folders are not the same
362362
if output_dir == bids_dir:
363-
config.loggers.cli.error(
363+
parser.error(
364364
'The selected output folder is the same as the input BIDS folder. '
365365
'Please modify the output path (suggestion: %s).'
366366
% bids_dir / 'derivatives' / ('fmriprep-%s' % version.split('+')[0])
367367
)
368368

369369
if bids_dir in work_dir.parents:
370-
config.loggers.cli.error(
370+
parser.error(
371371
'The selected working directory is a subdirectory of the input BIDS folder. '
372372
'Please modify the output path.'
373373
)

0 commit comments

Comments
 (0)