Skip to content

Commit 19c7e71

Browse files
oestebanyarikoptic
andcommitted
RF: reverting back to use pathlib for consistency
They are suggestsions from code review by Oscar Co-Authored-By: yarikoptic <[email protected]>
1 parent 8ea3c05 commit 19c7e71

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

fmriprep/cli/run.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -790,14 +790,14 @@ def build_workflow(opts, retval):
790790
# among different renderings of the same file, first remove any
791791
# existing one
792792
citation_files = {
793-
ext: str(logs_path / 'CITATION.' + ext)
793+
ext: logs_path / ('CITATION.%s' % ext)
794794
for ext in ('bib', 'tex', 'md', 'html')
795795
}
796796
for citation_file in citation_files.values():
797-
if op.lexists(citation_file):
797+
if citation_file.exists() or citation_file.is_symlink():
798798
citation_file.unlink()
799799

800-
Path(citation_files['md']).write_text(boilerplate)
800+
citation_files['md'].write_text(boilerplate)
801801
logger.log(25, 'Works derived from this fMRIPrep execution should '
802802
'include the following boilerplate:\n\n%s', boilerplate)
803803

@@ -806,8 +806,8 @@ def build_workflow(opts, retval):
806806
pkgrf('fmriprep', 'data/boilerplate.bib'),
807807
'--filter', 'pandoc-citeproc',
808808
'--metadata', 'pagetitle="fMRIPrep citation boilerplate"',
809-
citation_files['md'],
810-
'-o', citation_files['html']]
809+
str(citation_files['md']),
810+
'-o', str(citation_files['html'])]
811811
try:
812812
check_call(cmd, timeout=10)
813813
except (FileNotFoundError, CalledProcessError, TimeoutExpired):
@@ -817,8 +817,8 @@ def build_workflow(opts, retval):
817817
# Generate LaTex file resolving citations
818818
cmd = ['pandoc', '-s', '--bibliography',
819819
pkgrf('fmriprep', 'data/boilerplate.bib'),
820-
'--natbib', citation_files['md'],
821-
'-o', citation_files['tex']]
820+
'--natbib', str(citation_files['md']),
821+
'-o', str(citation_files['tex'])]
822822
try:
823823
check_call(cmd, timeout=10)
824824
except (FileNotFoundError, CalledProcessError, TimeoutExpired):

0 commit comments

Comments
 (0)