Skip to content

Commit 3df8489

Browse files
author
Mathieu Dubois
committed
FIX fix split_filename behaviour when path has no filename
1 parent 4553031 commit 3df8489

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

nipype/utils/filemanip.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -61,10 +61,8 @@ def split_filename(fname):
6161

6262
special_extensions = [".nii.gz", ".tar.gz"]
6363

64-
if fname and fname.endswith(os.path.sep):
65-
fname = fname[:-1]
66-
67-
pth, fname = os.path.split(fname)
64+
pth = os.path.dirname(fname)
65+
fname = os.path.basename(fname)
6866

6967
ext = None
7068
for special_ext in special_extensions:

0 commit comments

Comments
 (0)