Attempt to fix runloop error on MacOS.

This commit is contained in:
Dain Nilsson 2024-02-19 11:53:12 +01:00
parent 032dd8b853
commit 104c795339
No known key found for this signature in database
GPG Key ID: F04367096FBA95E8
1 changed files with 7 additions and 4 deletions

View File

@ -317,13 +317,16 @@ class MacCtapHidConnection(CtapHidConnection):
raise OSError(f"Failed to write report to device: {result}")
def read_packet(self):
read_thread = threading.Thread(target=_dev_read_thread, args=(self,))
read_thread.start()
read_thread.join()
try:
return self.read_queue.get(False)
except Empty:
raise OSError("Failed reading a response")
read_thread = threading.Thread(target=_dev_read_thread, args=(self,))
read_thread.start()
read_thread.join()
try:
return self.read_queue.get(False)
except Empty:
raise OSError("Failed reading a response")
def get_int_property(dev, key):