Skip to content

Commit cf9e64e

Browse files
authored
Merge pull request #2147 from lukassnoek/master
FIX: allow grabbing a single file (fix bug assuming string is not ite…
2 parents af55be6 + 72e8fd2 commit cf9e64e

File tree

1 file changed

+5
-6
lines changed

1 file changed

+5
-6
lines changed

nipype/interfaces/io.py

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -948,12 +948,11 @@ def _list_outputs(self):
948948
# We must convert to the local location specified
949949
# and download the files.
950950
for key,val in outputs.items():
951-
#This will basically be either list-like or string-like:
952-
#if it has the __iter__ attribute, it's list-like (list,
953-
#tuple, numpy array) and we iterate through each of its
954-
#values. If it doesn't, it's string-like (string,
955-
#unicode), and we convert that value directly.
956-
if hasattr(val,'__iter__'):
951+
# This will basically be either list-like or string-like:
952+
# if it's an instance of a list, we'll iterate through it.
953+
# If it isn't, it's string-like (string, unicode), we
954+
# convert that value directly.
955+
if isinstance(val, (list, tuple, set)):
957956
for i,path in enumerate(val):
958957
outputs[key][i] = self.s3tolocal(path, bkt)
959958
else:

0 commit comments

Comments
 (0)