Skip to content

Commit fd26e14

Browse files
committed
Formatting, made requirements error more specific
1 parent 49bb198 commit fd26e14

File tree

3 files changed

+9
-3
lines changed

3 files changed

+9
-3
lines changed

commands2/parallelcommandgroup.py

+3-1
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,9 @@ def addCommands(self, *commands: Command):
4949
for command in commands:
5050
in_common = command.getRequirements().intersection(self.requirements)
5151
if in_common:
52-
requirements_str = ", ".join([s.getName() for s in command.getRequirements()])
52+
requirements_str = ", ".join(
53+
[s.getName() for s in in_common]
54+
)
5355
raise IllegalCommandUse(
5456
f"Command {command.getName()} could not be added to this ParallelCommandGroup"
5557
f" because the subsystems [{requirements_str}] are already required in this command."

commands2/paralleldeadlinegroup.py

+3-1
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,9 @@ def addCommands(self, *commands: Command):
8585
for command in commands:
8686
in_common = command.getRequirements().intersection(self.requirements)
8787
if in_common:
88-
requirements_str = ", ".join([s.getName() for s in command.getRequirements()])
88+
requirements_str = ", ".join(
89+
[s.getName() for s in in_common]
90+
)
8991
raise IllegalCommandUse(
9092
f"Command {command.getName()} could not be added to this ParallelCommandGroup"
9193
f" because the subsystems [{requirements_str}] are already required in this command."

commands2/parallelracegroup.py

+3-1
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,9 @@ def addCommands(self, *commands: Command):
5151
for command in commands:
5252
in_common = command.getRequirements().intersection(self.requirements)
5353
if in_common:
54-
requirements_str = ", ".join([s.getName() for s in command.getRequirements()])
54+
requirements_str = ", ".join(
55+
[s.getName() for s in in_common]
56+
)
5557
raise IllegalCommandUse(
5658
f"Command {command.getName()} could not be added to this ParallelCommandGroup"
5759
f" because the subsystems [{requirements_str}] are already required in this command."

0 commit comments

Comments
 (0)