diff --git a/commands2/parallelcommandgroup.py b/commands2/parallelcommandgroup.py index 9645757..1a27779 100644 --- a/commands2/parallelcommandgroup.py +++ b/commands2/parallelcommandgroup.py @@ -49,7 +49,9 @@ def addCommands(self, *commands: Command): for command in commands: in_common = command.getRequirements().intersection(self.requirements) if in_common: - requirements_str = ", ".join([s.getName() for s in command.getRequirements()]) + requirements_str = ", ".join( + [s.getName() for s in in_common] + ) raise IllegalCommandUse( f"Command {command.getName()} could not be added to this ParallelCommandGroup" f" because the subsystems [{requirements_str}] are already required in this command." diff --git a/commands2/paralleldeadlinegroup.py b/commands2/paralleldeadlinegroup.py index 967a4c2..7fb4f9a 100644 --- a/commands2/paralleldeadlinegroup.py +++ b/commands2/paralleldeadlinegroup.py @@ -85,7 +85,9 @@ def addCommands(self, *commands: Command): for command in commands: in_common = command.getRequirements().intersection(self.requirements) if in_common: - requirements_str = ", ".join([s.getName() for s in command.getRequirements()]) + requirements_str = ", ".join( + [s.getName() for s in in_common] + ) raise IllegalCommandUse( f"Command {command.getName()} could not be added to this ParallelCommandGroup" f" because the subsystems [{requirements_str}] are already required in this command." diff --git a/commands2/parallelracegroup.py b/commands2/parallelracegroup.py index 6b04da6..04f2112 100644 --- a/commands2/parallelracegroup.py +++ b/commands2/parallelracegroup.py @@ -51,7 +51,9 @@ def addCommands(self, *commands: Command): for command in commands: in_common = command.getRequirements().intersection(self.requirements) if in_common: - requirements_str = ", ".join([s.getName() for s in command.getRequirements()]) + requirements_str = ", ".join( + [s.getName() for s in in_common] + ) raise IllegalCommandUse( f"Command {command.getName()} could not be added to this ParallelCommandGroup" f" because the subsystems [{requirements_str}] are already required in this command."