File tree Expand file tree Collapse file tree 1 file changed +6
-6
lines changed Expand file tree Collapse file tree 1 file changed +6
-6
lines changed Original file line number Diff line number Diff line change @@ -120,19 +120,19 @@ def abort(self) -> None:
120
120
121
121
# ------------------------------------------------
122
122
123
- def intern_read_ready (self ):
123
+ def intern_read_ready (self ) -> None :
124
124
"""Test if there are data waiting."""
125
125
try :
126
126
if data := self .sync_serial .read (1024 ):
127
- self .intern_protocol .data_received (data )
127
+ self .intern_protocol .data_received (data ) # type: ignore[attr-defined]
128
128
except serial .SerialException as exc :
129
129
self .close (exc = exc )
130
130
131
- def intern_write_ready (self ):
131
+ def intern_write_ready (self ) -> None :
132
132
"""Asynchronously write buffered data."""
133
133
data = b"" .join (self .intern_write_buffer )
134
134
try :
135
- if (nlen := self .sync_serial .write (data )) < len (data ):
135
+ if (nlen := self .sync_serial .write (data )) and nlen < len (data ):
136
136
self .intern_write_buffer = [data [nlen :]]
137
137
if not self .poll_task :
138
138
self .async_loop .add_writer (
@@ -154,8 +154,8 @@ async def polling_task(self):
154
154
self .intern_write_ready ()
155
155
if self .sync_serial .in_waiting :
156
156
self .intern_read_ready ()
157
- except asyncio .CancelledError as exc :
158
- self .close (exc )
157
+ except asyncio .CancelledError :
158
+ self .close (None )
159
159
160
160
161
161
async def create_serial_connection (
You can’t perform that action at this time.
0 commit comments