Skip to content

Commit 53a2880

Browse files
committed
MNT: Remove Python <=3.5 hack
1 parent 1a16aa1 commit 53a2880

File tree

1 file changed

+2
-24
lines changed

1 file changed

+2
-24
lines changed

nipype/utils/filemanip.py

Lines changed: 2 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -28,30 +28,8 @@
2828
related_filetype_sets = [(".hdr", ".img", ".mat"), (".nii", ".mat"), (".BRIK", ".HEAD")]
2929

3030

31-
def _resolve_with_filenotfound(path, **kwargs):
32-
"""Raise FileNotFoundError instead of OSError"""
33-
try:
34-
return path.resolve(**kwargs)
35-
except OSError as e:
36-
if isinstance(e, FileNotFoundError):
37-
raise
38-
raise FileNotFoundError(str(path))
39-
40-
41-
def path_resolve(path, strict=False):
42-
try:
43-
return _resolve_with_filenotfound(path, strict=strict)
44-
except TypeError: # PY35
45-
pass
46-
47-
path = path.absolute()
48-
if strict or path.exists():
49-
return _resolve_with_filenotfound(path)
50-
51-
# This is a hacky shortcut, using path.absolute() unmodified
52-
# In cases where the existing part of the path contains a
53-
# symlink, different results will be produced
54-
return path
31+
# Previously a patch, not worth deprecating
32+
path_resolve = Path.resolve
5533

5634

5735
def split_filename(fname):

0 commit comments

Comments
 (0)