hidapi: Remove Python 2 compatibility (#2460)

Related #2273
This commit is contained in:
MattHag 2024-04-30 14:19:50 +02:00 committed by GitHub
parent 74e126e015
commit 704a87696f
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 1 additions and 11 deletions

View File

@ -29,16 +29,6 @@ from threading import Thread
import hidapi as _hid
#
#
#
try:
read_packet = raw_input
except NameError:
# Python 3 equivalent of raw_input
read_packet = input
interactive = os.isatty(0)
prompt = "?? Input: " if interactive else ""
start_time = time.time()
@ -217,7 +207,7 @@ def main():
sys.stdout.write("\033[300B") # move cusor at most 300 lines down, don't scroll
while t.is_alive():
line = read_packet(prompt)
line = input(prompt)
line = line.strip().replace(" ", "")
# print ("line", line)
if not line: