summaryrefslogtreecommitdiff
path: root/serial/serialposix.py
diff options
context:
space:
mode:
Diffstat (limited to 'serial/serialposix.py')
-rw-r--r--serial/serialposix.py5
1 files changed, 5 insertions, 0 deletions
diff --git a/serial/serialposix.py b/serial/serialposix.py
index 131e31b..fa5c999 100644
--- a/serial/serialposix.py
+++ b/serial/serialposix.py
@@ -506,6 +506,11 @@ class PosixSerial(SerialBase):
_, ready, _ = select.select([], [self.fd], [], timeleft)
if not ready:
raise writeTimeoutError
+ else:
+ # wait for write operation
+ _, ready, _ = select.select([], [self.fd], [], None)
+ if not ready:
+ raise SerialException('write failed (select)')
d = d[n:]
tx_len -= n
except OSError, v: