diff --git a/lib/galaxy/tool_util/toolbox/base.py b/lib/galaxy/tool_util/toolbox/base.py index c114e612ec76..03f483546502 100644 --- a/lib/galaxy/tool_util/toolbox/base.py +++ b/lib/galaxy/tool_util/toolbox/base.py @@ -1153,10 +1153,7 @@ def register_tool(self, tool): self._tools_by_id[tool_id] = tool else: self._tools_by_id[tool_id] = tool - old_id = tool.old_id - if old_id not in self._tools_by_old_id: - self._tools_by_old_id[old_id] = [] - self._tools_by_old_id[old_id].append(tool) + self._tools_by_old_id.setdefault(tool.old_id, []).append(tool) def package_tool(self, trans, tool_id): """