Skip to content

Commit

Permalink
Attempt to fix runloop error on MacOS.
Browse files Browse the repository at this point in the history
  • Loading branch information
dainnilsson committed Feb 19, 2024
1 parent 032dd8b commit 104c795
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions fido2/hid/macos.py
Original file line number Diff line number Diff line change
Expand Up @@ -317,13 +317,16 @@ def write_packet(self, packet):
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):
Expand Down

0 comments on commit 104c795

Please sign in to comment.