Skip to content

Commit ae048d5

Browse files
keysmashestetron
authored andcommitted
Fix crash with carets in secondaryFiles (#826)
* Fix crash with carets in secondaryFiles Fixes #824. * Fix crash when secondaryFile consists of only carets
1 parent 03b817a commit ae048d5

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

cwltool/builder.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,8 +50,12 @@ def content_limit_respected_read(f): # type: (IO) -> Text
5050

5151

5252
def substitute(value, replace): # type: (Text, Text) -> Text
53-
if replace[0] == "^":
54-
return substitute(value[0:value.rindex('.')], replace[1:])
53+
if replace.startswith("^"):
54+
try:
55+
return substitute(value[0:value.rindex('.')], replace[1:])
56+
except ValueError:
57+
# No extension to remove
58+
return value + replace.lstrip("^")
5559
return value + replace
5660

5761
def formatSubclassOf(fmt, cls, ontology, visited):

0 commit comments

Comments
 (0)