Skip to content

Commit 4e5b25d

Browse files
jabdoa2rob-smallshire
authored andcommitted
same error handling in fast path as in async path. fix #23 (#24)
1 parent 173922f commit 4e5b25d

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

serial_asyncio/__init__.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -118,6 +118,8 @@ def write(self, data):
118118
# Attempt to send it right away first
119119
try:
120120
n = self._serial.write(data)
121+
except (BlockingIOError, InterruptedError):
122+
n = 0
121123
except serial.SerialException as exc:
122124
self._fatal_error(exc, 'Fatal write error on serial transport')
123125
return

0 commit comments

Comments
 (0)