Skip to content

Commit fc70fd7

Browse files
committed
posix: timeout only applies to blocking I/O
see pyserial#227
1 parent 10d79d9 commit fc70fd7

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

serial/serialposix.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -573,7 +573,7 @@ def write(self, data):
573573
# see also http://www.python.org/dev/peps/pep-3151/#select
574574
if e[0] not in (errno.EAGAIN, errno.EALREADY, errno.EWOULDBLOCK, errno.EINPROGRESS, errno.EINTR)):
575575
raise SerialException('write failed: {}'.format(e))
576-
if timeout.expired():
576+
if not timeout.is_non_blocking and timeout.expired():
577577
raise writeTimeoutError
578578
return length - len(d)
579579

0 commit comments

Comments
 (0)