Skip to content

Commit d729a11

Browse files
committed
FIX: Handle missing paths better pre-3.6
1 parent 2328beb commit d729a11

File tree

1 file changed

+9
-4
lines changed

1 file changed

+9
-4
lines changed

nipype/utils/filemanip.py

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -64,10 +64,15 @@ def path_resolve(path, strict=False):
6464
try:
6565
return path.resolve(strict=strict)
6666
except TypeError: # PY35
67-
resolved = path.resolve()
68-
if strict and not resolved.exists():
69-
raise FileNotFoundError(resolved)
70-
return resolved
67+
pass
68+
69+
if strict or path.exists():
70+
return path.resolve()
71+
72+
# This is a hacky shortcut
73+
# In cases where the existing part of the path contains a
74+
# symlink, different results will be produced
75+
return path.absolute()
7176

7277

7378
def path_mkdir(path, mode=0o777, parents=False, exist_ok=False):

0 commit comments

Comments
 (0)