Skip to content

Commit 30f32f8

Browse files
committed
Merge pull request #41 from smoe/patch-1
Do not ask to select from list with single element
2 parents 3ddc89c + 5c8360a commit 30f32f8

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

cwltool/main.py

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -314,10 +314,13 @@ def load_tool(argsworkflow, updateonly, strict, makeTool, debug,
314314
if urifrag:
315315
processobj, _ = document_loader.resolve_ref(uri)
316316
elif isinstance(processobj, list):
317-
_logger.error("Tool file contains graph of multiple objects, must specify one of #%s",
318-
", #".join(urlparse.urldefrag(i["id"])[1]
319-
for i in processobj if "id" in i))
320-
return 1
317+
if 1 == len(processobj):
318+
processobj = processobj[0]
319+
else:
320+
_logger.error("Tool file contains graph of multiple objects, must specify one of #%s",
321+
", #".join(urlparse.urldefrag(i["id"])[1]
322+
for i in processobj if "id" in i))
323+
return 1
321324

322325
try:
323326
t = makeTool(processobj, strict=strict, makeTool=makeTool, loader=document_loader, avsc_names=avsc_names)

0 commit comments

Comments
 (0)