77#
88# SPDX-License-Identifier: BSD-3-Clause
99"""\
10- Support asyncio with pyserial_asyncio ports. EXPERIMENTAL
10+ Support asyncio with serial ports. EXPERIMENTAL
1111
1212Posix platforms only, Python 3.4+ only.
1313
@@ -29,7 +29,7 @@ class SerialTransport(asyncio.Transport):
2929 This allows protocol implementations to be developed against the
3030 transport abstraction without needing to know the details of the
3131 underlying channel, such as whether it is a pipe, a socket, or
32- indeed a serial_asyncio port.
32+ indeed a serial port.
3333
3434
3535 You generally won’t instantiate a transport yourself; instead, you
@@ -67,7 +67,7 @@ def serial(self):
6767 return self ._serial
6868
6969 def __repr__ (self ):
70- return '{self.__class__.__name__}({self._loop}, {self._protocol}, {self.serial_asyncio })' .format (self = self )
70+ return '{self.__class__.__name__}({self._loop}, {self._protocol}, {self.serial })' .format (self = self )
7171
7272 def is_closing (self ):
7373 """Return True if the transport is closing or closed."""
@@ -108,7 +108,7 @@ def write(self, data):
108108 try :
109109 n = self ._serial .write (data )
110110 except serial .SerialException as exc :
111- self ._fatal_error (exc , 'Fatal write error on serial_asyncio transport' )
111+ self ._fatal_error (exc , 'Fatal write error on serial transport' )
112112 return
113113 if n == len (data ):
114114 return # Whole request satisfied
@@ -221,7 +221,7 @@ def _write_ready(self):
221221
222222 This method is called back asynchronously as a writer
223223 registered with the asyncio event-loop against the
224- underlying file descriptor for the serial_asyncio port.
224+ underlying file descriptor for the serial port.
225225
226226 Should the write-buffer become empty if this method
227227 is invoked while the transport is closing, the protocol's
@@ -239,7 +239,7 @@ def _write_ready(self):
239239 except (BlockingIOError , InterruptedError ):
240240 self ._write_buffer .append (data )
241241 except serial .SerialException as exc :
242- self ._fatal_error (exc , 'Fatal write error on serial_asyncio transport' )
242+ self ._fatal_error (exc , 'Fatal write error on serial transport' )
243243 else :
244244 if n == len (data ):
245245 assert self ._flushed ()
@@ -291,7 +291,7 @@ def _set_write_buffer_limits(self, high=None, low=None):
291291 self ._high_water = high
292292 self ._low_water = low
293293
294- def _fatal_error (self , exc , message = 'Fatal error on serial_asyncio transport' ):
294+ def _fatal_error (self , exc , message = 'Fatal error on serial transport' ):
295295 """Report a fatal error to the event-loop and abort the transport."""
296296 self ._loop .call_exception_handler ({
297297 'message' : message ,
@@ -341,7 +341,7 @@ def _call_connection_lost(self, exc):
341341 """Close the connection.
342342
343343 Informs the protocol through connection_lost() and clears
344- pending buffers and closes the serial_asyncio connection.
344+ pending buffers and closes the serial connection.
345345 """
346346 assert self ._closing
347347 assert not self ._has_writer
0 commit comments