Skip to content

Commit d0f29dc

Browse files
committed
avoid much string manip
1 parent 704b97d commit d0f29dc

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

nipype/interfaces/io.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -592,10 +592,8 @@ def _upload_to_s3(self, bucket, src, dst):
592592
s3_prefix = s3_str + bucket.name
593593

594594
# Explicitly lower-case the "s3"
595-
if dst.lower().startswith(s3_str):
596-
dst_sp = dst.split('/')
597-
dst_sp[0] = dst_sp[0].lower()
598-
dst = '/'.join(dst_sp)
595+
if dst[:len(s3_str)].lower().startswith(s3_str):
596+
dst = s3_str + dst[len(s3_str):]
599597

600598
# If src is a directory, collect files (this assumes dst is a dir too)
601599
if os.path.isdir(src):

0 commit comments

Comments
 (0)