aboutsummaryrefslogtreecommitdiff
path: root/lib/PacketManager
diff options
context:
space:
mode:
authorRitabrata Das <[email protected]>2025-02-11 13:48:03 +0530
committerRitabrata Das <[email protected]>2025-02-11 13:48:03 +0530
commit5878c96b2906a06a8bd26df383f4d0ed924b34d3 (patch)
tree860fed3c41dde0862d14a1525c15e0a0f2b60ab4 /lib/PacketManager
parent0a2325598f27d559b583ae37a8586d2d7552d6f9 (diff)
Pipe operator is not supported on Python 3.10 and below, Add Backwards compatiblity
Diffstat (limited to 'lib/PacketManager')
-rw-r--r--lib/PacketManager/packets/FSNETCMD_AIRCMD.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/PacketManager/packets/FSNETCMD_AIRCMD.py b/lib/PacketManager/packets/FSNETCMD_AIRCMD.py
index 6770079..beaade8 100644
--- a/lib/PacketManager/packets/FSNETCMD_AIRCMD.py
+++ b/lib/PacketManager/packets/FSNETCMD_AIRCMD.py
@@ -1,5 +1,6 @@
from struct import pack, unpack
from .constants import AIRCMD_KEYWORDS
+from typing import Union # Make it backwards compatible for python 3.9
class FSNETCMD_AIRCMD: #30
@@ -53,7 +54,7 @@ class FSNETCMD_AIRCMD: #30
return FSNETCMD_AIRCMD.encode(aircraft_id, message, with_size)
@staticmethod
- def set_command(aircraft_id:int, command:str, value:int|str, with_size:bool=False):
+ def set_command(aircraft_id:int, command:str, value: Union[str, int], with_size:bool=False):
"""
This will set the command of the aircraft, useful if you want to
set the engine power, fuel, etc.