Skip to content

Commit f193901

Browse files
committed
Python 3.8 & 3.9 does not support '|' to union two types (type hints); switched to legacy Union technique.
1 parent 74a72fb commit f193901

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

commands2/profiledpidsubsystem.py

+5-2
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,13 @@
22
# Open Source Software; you can modify and/or share it under the terms of
33
# the WPILib BSD license file in the root directory of this project.
44

5+
from typing import Union
6+
57
from wpimath.controller import ProfiledPIDController
6-
from .subsystem import Subsystem
78
from wpimath.trajectory import TrapezoidProfile
89

10+
from .subsystem import Subsystem
11+
912

1013
class ProfiledPIDSubsystem(Subsystem):
1114
"""
@@ -32,7 +35,7 @@ def getController(self) -> ProfiledPIDController:
3235
"""Returns the ProfiledPIDController."""
3336
return self._controller
3437

35-
def setGoal(self, goal: TrapezoidProfile.State | float):
38+
def setGoal(self, goal: Union[TrapezoidProfile.State, float]):
3639
"""
3740
Sets the goal state for the subsystem.
3841
"""

0 commit comments

Comments
 (0)