From ea71bdfba6413ff05aef2fe99b4784d63266145b Mon Sep 17 00:00:00 2001 From: PJ Reiniger Date: Sat, 13 Dec 2025 15:11:29 -0500 Subject: [PATCH] [py][cmd2] Fix opmodes merge (#8473) Looks like a build failure got lost in the landing order of python commands and the big opmode change. This makes it compile again, based on the java / C++ changes from the opmode PR. --- commandsv2/src/main/python/commands2/commandscheduler.py | 6 +++--- commandsv2/src/test/python/test_robotdisabledcommand.py | 1 - 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/commandsv2/src/main/python/commands2/commandscheduler.py b/commandsv2/src/main/python/commands2/commandscheduler.py index 73cc471b75..908395ca40 100644 --- a/commandsv2/src/main/python/commands2/commandscheduler.py +++ b/commandsv2/src/main/python/commands2/commandscheduler.py @@ -10,7 +10,7 @@ import hal from typing_extensions import Self from wpilib import ( RobotBase, - RobotState, + DriverStation, TimedRobot, Watchdog, reportWarning, @@ -191,7 +191,7 @@ class CommandScheduler(Sendable): if self.isScheduled(command): return - if RobotState.isDisabled() and not command.runsWhenDisabled(): + if DriverStation.isDisabled() and not command.runsWhenDisabled(): return requirements = command.getRequirements() @@ -249,7 +249,7 @@ class CommandScheduler(Sendable): self._watchdog.addEpoch("buttons.run()") self._inRunLoop = True - isDisabled = RobotState.isDisabled() + isDisabled = DriverStation.isDisabled() # Run scheduled commands, remove finished commands. for command in self._scheduledCommands.copy(): diff --git a/commandsv2/src/test/python/test_robotdisabledcommand.py b/commandsv2/src/test/python/test_robotdisabledcommand.py index 120dc07018..beb9729bed 100644 --- a/commandsv2/src/test/python/test_robotdisabledcommand.py +++ b/commandsv2/src/test/python/test_robotdisabledcommand.py @@ -7,7 +7,6 @@ if TYPE_CHECKING: from .util import * import pytest -from wpilib import RobotState def test_robotDisabledCommandCancel(scheduler: commands2.CommandScheduler):