Skip to content

Commit 6db18b7

Browse files
committed
Only set the EnvVarRequirement cache entry if it would contain anything
1 parent ee8d778 commit 6db18b7

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

cwltool/command_line_tool.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -909,7 +909,8 @@ def remove_prefix(s: str, prefix: str) -> str:
909909
f"Attempting to preserve environment variable {key!r} which is not present"
910910
)
911911

912-
keydict["EnvVarRequirement"] = env_def
912+
if env_def:
913+
keydict["EnvVarRequirement"] = env_def
913914
keydictstr = json_dumps(keydict, separators=(",", ":"), sort_keys=True)
914915
cachekey = hashlib.md5(keydictstr.encode("utf-8")).hexdigest() # nosec
915916

0 commit comments

Comments
 (0)