From bc9cc744e8c5f4f2fde84a19a742011d063278f9 Mon Sep 17 00:00:00 2001 From: Peter Amstutz Date: Thu, 13 Apr 2017 15:41:56 -0400 Subject: [PATCH] Fix mergedirs() so it doesn't fail if a Directory object lacks a listing field. (#366) --- cwltool/process.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cwltool/process.py b/cwltool/process.py index 15b633272..374780759 100644 --- a/cwltool/process.py +++ b/cwltool/process.py @@ -689,8 +689,8 @@ def mergedirs(listing): for e in listing: if e["basename"] not in ents: ents[e["basename"]] = e - elif e["class"] == "Directory": - ents[e["basename"]]["listing"].extend(e["listing"]) + elif e["class"] == "Directory" and e.get("listing"): + ents[e["basename"]].setdefault("listing", []).extend(e["listing"]) for e in ents.itervalues(): if e["class"] == "Directory" and "listing" in e: e["listing"] = mergedirs(e["listing"])