Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
FSL
fslpy
Commits
c3e50e94
Commit
c3e50e94
authored
Jun 02, 2022
by
Paul McCarthy
🚵
Browse files
MNT: Convert all Path arguments to absolute path strings
parent
759da952
Changes
1
Hide whitespace changes
Inline
Side-by-side
fsl/wrappers/wrapperutils.py
View file @
c3e50e94
...
...
@@ -874,11 +874,8 @@ class FileOrThing:
# accept an output prefix which contains
# a directory path.
if
prefix
is
not
None
:
# Accept pathlib, but all the
# code below works on strings
if
isinstance
(
prefix
,
pathlib
.
Path
):
prefix
=
str
(
prefix
)
prefix
=
op
.
abspath
(
prefix
)
# If prefix is set to LOAD,
# all generated output files
...
...
@@ -971,6 +968,15 @@ class FileOrThing:
if
realPrefix
is
not
None
and
len
(
prefixedFiles
)
==
0
:
allargs
[
self
.
__outprefix
]
=
realPrefix
# Turn any Path objects into absolute path
# strings. Don't use Path.resolve(), as it
# returns a relative path for non-existent
# files/dirs on Windows/certain Python
# versions.
for
k
,
v
in
allargs
.
items
():
if
isinstance
(
v
,
pathlib
.
Path
):
allargs
[
k
]
=
op
.
abspath
(
v
)
args
=
[
allargs
.
pop
(
k
)
for
k
in
argnames
]
kwargs
=
allargs
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment