Skip to content

Commit

Permalink
fixed catching error of select call (#47)
Browse files Browse the repository at this point in the history
  • Loading branch information
franzhaas authored Dec 14, 2024
1 parent abf8198 commit be8c0f9
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion atests/nfc_nci/nci_interface.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import serial
import select
import io
import time


Expand Down Expand Up @@ -34,7 +35,7 @@ def wait_for_data_from_nci(self, timeout: float = 1.0):
if self._serial_connection and self._serial_connection.is_open:
try:
select.select([self._serial_connection.fileno()], [], [], timeout)
except AttributeError:
except io.UnsupportedOperation:
# Windows does not support select on serial ports, so we have to do it the hard way
endTime = time.time() + timeout
while time.time() < endTime and not self._serial_connection.in_waiting:
Expand Down

0 comments on commit be8c0f9

Please sign in to comment.