commit | c6362db12e0251811a8ea28a5405ec9a51ee7af8 | [log] [tgz] |
---|---|---|
author | Chris Liechti <cliechti@gmx.net> | Sun Dec 13 23:44:35 2015 +0100 |
committer | Chris Liechti <cliechti@gmx.net> | Sun Dec 13 23:44:35 2015 +0100 |
tree | 23fb861acaae15f6e87c769bb192f4ea039a8aba | |
parent | a629c5d6b1b589efbdae27c705c7bf5654c1a0dc [diff] [blame] |
check for write timeout, even if EAGAIN was rised, fix #45
diff --git a/serial/serialposix.py b/serial/serialposix.py index 2476cb0..e2835e7 100644 --- a/serial/serialposix.py +++ b/serial/serialposix.py
@@ -540,6 +540,9 @@ except OSError as v: if v.errno != errno.EAGAIN: raise SerialException('write failed: %s' % (v,)) + # still calculate and check timeout + if timeout and timeout - time.time() < 0: + raise writeTimeoutError return len(data) def flush(self):