Skip to content

Commit

Permalink
Fix mergedirs() so it doesn't fail if a Directory object lacks a list…
Browse files Browse the repository at this point in the history
…ing field. (#366)
  • Loading branch information
tetron authored Apr 13, 2017
1 parent c3e48eb commit bc9cc74
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions cwltool/process.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"])
Expand Down

0 comments on commit bc9cc74

Please sign in to comment.