Skip to content

Commit 7610534

Browse files
authored
Update cli.py
1 parent 92a7c6e commit 7610534

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

caltechdata_api/cli.py

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -417,10 +417,13 @@ def upload_supporting_file(record_id=None):
417417
elif filename == "n":
418418
break
419419
elif (not len(filename) == 0) and (filename[len(filename) - 1] == '/'):
420-
files_name = files[int(filename[0])-1]
421-
filepath = os.path.abspath(files_name)
422-
filepaths.append(filepath)
423-
print("File added successfully")
420+
try:
421+
files_name = files[int(filename[0])-1]
422+
filepath = os.path.abspath(files_name)
423+
filepaths.append(filepath)
424+
print("File added successfully")
425+
except ValueError:
426+
continue
424427
elif filename in files:
425428
file_size = os.path.getsize(filename)
426429
if file_size > 1024 * 1024 * 1024:

0 commit comments

Comments
 (0)